-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.py
153 lines (134 loc) · 7.07 KB
/
colors.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Black = (0,0,0)
White = (1,1,1)
Read = (1,0,0)
Green = (0,1,0)
Blue = (0,0,1)
class Palette:
def __init__(self, colors):
self.colors = colors
def __len__(self):
return len(self.colors)
def __getitem__(self, item):
l = len(self.colors)
if isinstance(item, int) and item >= l:
return self.colors[item % l]
return self.colors[item]
Accent = Palette((
(0.49803921568627452, 0.78823529411764703, 0.49803921568627452),
(0.74509803921568629, 0.68235294117647061, 0.83137254901960789),
(0.99215686274509807, 0.75294117647058822, 0.52549019607843139),
(1.0, 1.0, 0.6 ),
(0.2196078431372549, 0.42352941176470588, 0.69019607843137254),
(0.94117647058823528, 0.00784313725490196, 0.49803921568627452),
(0.74901960784313726, 0.35686274509803922, 0.09019607843137254),
(0.4, 0.4, 0.4 ),
))
Dark2 = Palette((
(0.10588235294117647, 0.61960784313725492, 0.46666666666666667),
(0.85098039215686272, 0.37254901960784315, 0.00784313725490196),
(0.45882352941176469, 0.4392156862745098, 0.70196078431372544),
(0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
(0.4, 0.65098039215686276, 0.11764705882352941),
(0.90196078431372551, 0.6705882352941176, 0.00784313725490196),
(0.65098039215686276, 0.46274509803921571, 0.11372549019607843),
(0.4, 0.4, 0.4 ),
))
Paired = Palette((
(0.65098039215686276, 0.80784313725490198, 0.8901960784313725 ),
(0.12156862745098039, 0.47058823529411764, 0.70588235294117652),
(0.69803921568627447, 0.87450980392156863, 0.54117647058823526),
(0.2, 0.62745098039215685, 0.17254901960784313),
(0.98431372549019602, 0.60392156862745094, 0.6 ),
(0.8901960784313725, 0.10196078431372549, 0.10980392156862745),
(0.99215686274509807, 0.74901960784313726, 0.43529411764705883),
(1.0, 0.49803921568627452, 0.0 ),
(0.792156862745098, 0.69803921568627447, 0.83921568627450982),
(0.41568627450980394, 0.23921568627450981, 0.60392156862745094),
(1.0, 1.0, 0.6 ),
(0.69411764705882351, 0.34901960784313724, 0.15686274509803921),
))
Pastel1 = Palette((
(0.98431372549019602, 0.70588235294117652, 0.68235294117647061),
(0.70196078431372544, 0.80392156862745101, 0.8901960784313725 ),
(0.8, 0.92156862745098034, 0.77254901960784317),
(0.87058823529411766, 0.79607843137254897, 0.89411764705882357),
(0.99607843137254903, 0.85098039215686272, 0.65098039215686276),
(1.0, 1.0, 0.8 ),
(0.89803921568627454, 0.84705882352941175, 0.74117647058823533),
(0.99215686274509807, 0.85490196078431369, 0.92549019607843142),
(0.94901960784313721, 0.94901960784313721, 0.94901960784313721),
))
Pastel2 = Palette((
(0.70196078431372544, 0.88627450980392153, 0.80392156862745101),
(0.99215686274509807, 0.80392156862745101, 0.67450980392156867),
(0.79607843137254897, 0.83529411764705885, 0.90980392156862744),
(0.95686274509803926, 0.792156862745098, 0.89411764705882357),
(0.90196078431372551, 0.96078431372549022, 0.78823529411764703),
(1.0, 0.94901960784313721, 0.68235294117647061),
(0.94509803921568625, 0.88627450980392153, 0.8 ),
(0.8, 0.8, 0.8 ),
))
Set1 = Palette((
(0.89411764705882357, 0.10196078431372549, 0.10980392156862745),
(0.21568627450980393, 0.49411764705882355, 0.72156862745098038),
(0.30196078431372547, 0.68627450980392157, 0.29019607843137257),
(0.59607843137254901, 0.30588235294117649, 0.63921568627450975),
(1.0, 0.49803921568627452, 0.0 ),
(1.0, 1.0, 0.2 ),
(0.65098039215686276, 0.33725490196078434, 0.15686274509803921),
(0.96862745098039216, 0.50588235294117645, 0.74901960784313726),
(0.6, 0.6, 0.6),
))
Set2 = Palette((
(0.4, 0.76078431372549016, 0.6470588235294118 ),
(0.9882352941176471, 0.55294117647058827, 0.3843137254901961 ),
(0.55294117647058827, 0.62745098039215685, 0.79607843137254897),
(0.90588235294117647, 0.54117647058823526, 0.76470588235294112),
(0.65098039215686276, 0.84705882352941175, 0.32941176470588235),
(1.0, 0.85098039215686272, 0.18431372549019609),
(0.89803921568627454, 0.7686274509803922, 0.58039215686274515),
(0.70196078431372544, 0.70196078431372544, 0.70196078431372544),
))
Set3 = Palette((
(0.55294117647058827, 0.82745098039215681, 0.7803921568627451 ),
(1.0, 1.0, 0.70196078431372544),
(0.74509803921568629, 0.72941176470588232, 0.85490196078431369),
(0.98431372549019602, 0.50196078431372548, 0.44705882352941179),
(0.50196078431372548, 0.69411764705882351, 0.82745098039215681),
(0.99215686274509807, 0.70588235294117652, 0.3843137254901961 ),
(0.70196078431372544, 0.87058823529411766, 0.41176470588235292),
(0.9882352941176471, 0.80392156862745101, 0.89803921568627454),
(0.85098039215686272, 0.85098039215686272, 0.85098039215686272),
(0.73725490196078436, 0.50196078431372548, 0.74117647058823533),
(0.8, 0.92156862745098034, 0.77254901960784317),
(1.0, 0.92941176470588238, 0.43529411764705883),
))
YlGnBu = Palette((
(1.0 , 1.0 , 0.85098039215686272),
(0.92941176470588238, 0.97254901960784312 , 0.69411764705882351),
(0.7803921568627451 , 0.9137254901960784 , 0.70588235294117652),
(0.49803921568627452, 0.80392156862745101 , 0.73333333333333328),
(0.25490196078431371, 0.71372549019607845 , 0.7686274509803922 ),
(0.11372549019607843, 0.56862745098039214 , 0.75294117647058822),
(0.13333333333333333, 0.36862745098039218 , 0.6588235294117647 ),
(0.14509803921568629, 0.20392156862745098 , 0.58039215686274515),
(0.03137254901960784, 0.11372549019607843 , 0.34509803921568627)
))
Spectral = Palette((
(0.61960784313725492, 0.003921568627450980, 0.25882352941176473),
(0.83529411764705885, 0.24313725490196078 , 0.30980392156862746),
(0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
(0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
(0.99607843137254903, 0.8784313725490196 , 0.54509803921568623),
(1.0 , 1.0 , 0.74901960784313726),
(0.90196078431372551, 0.96078431372549022 , 0.59607843137254901),
(0.6705882352941176 , 0.8666666666666667 , 0.64313725490196083),
(0.4 , 0.76078431372549016 , 0.6470588235294118 ),
(0.19607843137254902, 0.53333333333333333 , 0.74117647058823533),
(0.36862745098039218, 0.30980392156862746 , 0.63529411764705879)
))
Discrete = Set3
Diverging = Spectral
Sequential = YlGnBu
def add_alpha(c3, alpha):
return c3[0], c3[1], c3[2], alpha