aboutsummaryrefslogtreecommitdiff
path: root/code/sunlab/common/plotting/colors.py
blob: c4fc7277acf9539a8144574bbc6fa78d5a8d5f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class PhenotypeColors:
    """# Phenotype Colorings

    Standardization for the different phenotype colors"""

    def __init__(self):
        """# Empty Construtor"""
        pass

    def get_basic_colors(self, transition=False):
        """# Return the Color Names

        - transition: Returns the color for the transition class too"""
        if transition:
            return ["yellow", "purple", "green", "blue", "cyan"]
        return ["yellow", "purple", "green", "blue"]

    def get_colors(self, transition=False):
        """# Return the Color Names

        - transition: Returns the color for the transition class too"""
        if transition:
            return ["#ffff00", "#ff3cfa", "#11f309", "#213ff0", "cyan"]
        return ["#ffff00", "#ff3cfa", "#11fe09", "#213ff0"]

    def get_colormap(self, transition=False):
        """# Return the Matplotlib Colormap

        - transition: Returns the color for the transition class too"""
        from matplotlib.colors import ListedColormap as LC

        return LC(self.get_colors(transition))


# Basic Exports
Pcolor = PhenotypeColors().get_colors()
Pmap = PhenotypeColors().get_colormap()
Pmapx = PhenotypeColors().get_colormap(True)