-
Notifications
You must be signed in to change notification settings - Fork 0
/
color.py
169 lines (165 loc) · 3.58 KB
/
color.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/env python
# -*- coding: utf-8 -*-
COLORS = {
0xfa9cb8: u"鴇色",
0xcf4078: u"躑躅色",
0xfbdade: u"桜色",
0xd53e62: u"薔薇色",
0xe64b6b: u"韓紅",
0xff7f8f: u"珊瑚色",
0xdf828a: u"紅梅色",
0xe38089: u"桃色",
0xbe003f: u"紅色",
0xb81a3e: u"紅赤",
0xad3140: u"臙脂",
0x94474b: u"蘇芳",
0x9e2236: u"茜色",
0xbe0032: u"赤",
0xef454a: u"朱色",
0x9e413f: u"紅樺色",
0xef4644: u"紅緋",
0xd1483e: u"鉛丹色",
0x6d3a33: u"紅海老茶",
0x7a453d: u"鳶色",
0x905d54: u"小豆色",
0x863e33: u"弁柄色",
0x693c34: u"海老茶",
0xea4e31: u"金赤",
0xad4e39: u"赤茶",
0x8d3927: u"赤錆色",
0xeb6940: u"黄丹",
0xe65226: u"赤橙",
0xdb5c35: u"柿色",
0xb5725c: u"肉桂色",
0xb64826: u"樺色",
0x914c35: u"煉瓦色",
0x624035: u"錆色",
0x865c4b: u"檜皮色",
0x704b38: u"栗色",
0xd86011: u"黄赤",
0xb26235: u"代赭",
0xb0764f: u"駱駝色",
0xb1632a: u"黄茶",
0xf1bb93: u"肌色",
0xef810f: u"橙色",
0x816551: u"灰茶",
0x6d4c33: u"茶色",
0x564539: u"焦茶",
0xfaa55c: u"柑子色",
0xd89f6d: u"杏色",
0xeb8400: u"蜜柑色",
0x6b3e08: u"褐色",
0x9f6c31: u"土色",
0xd4a168: u"小麦色",
0xaa7a40: u"琥珀色",
0xb47700: u"金茶",
0xf4bd6b: u"卵色",
0xf8a900: u"山吹色",
0xb8883b: u"黄土色",
0x847461: u"朽葉色",
0xffbb00: u"向日葵色",
0xedae00: u"鬱金色",
0xc5b69e: u"砂色",
0xc8a65d: u"芥子色",
0xe3c700: u"黄",
0xe3c700: u"蒲公英色",
0x6a5f37: u"鶯茶",
0xedd60e: u"中黄",
0xead56b: u"刈安色",
0xd6c949: u"黄檗色",
0x716b4a: u"海松色",
0xc2bd3d: u"鶸色",
0x706c3e: u"鶯色",
0xc0ba7f: u"抹茶色",
0xbbc000: u"黄緑",
0x7c7a37: u"苔色",
0xaab300: u"若草色",
0x97a61e: u"萌黄",
0x737c3e: u"草色",
0xa9c087: u"若葉色",
0x687e52: u"松葉色",
0xbadbc7: u"白緑",
0x00b66e: u"緑",
0x007b50: u"常磐色",
0x4d8169: u"緑青色",
0x3c6754: u"千歳緑",
0x005638: u"深緑",
0x00533e: u"萌葱色",
0x00a37e: u"若竹色",
0x6da895: u"青磁色",
0x6aa89d: u"青竹色",
0x24433e: u"鉄色",
0x008e94: u"青緑",
0x608a8e: u"錆浅葱",
0x6d969c: u"水浅葱",
0x53a8b7: u"新橋色",
0x00859b: u"浅葱",
0x73b3c1: u"白群",
0x00687c: u"納戸色",
0x7eb1c1: u"甕覗き",
0x9dcce0: u"水色",
0x576d79: u"藍鼠",
0x89bdde: u"空色",
0x006ab6: u"青",
0x2b4b65: u"藍色",
0x223546: u"濃藍",
0x89acd7: u"勿忘草色",
0x007bc3: u"露草色",
0x2b618f: u"縹色",
0x3a4861: u"紺青",
0x00519a: u"瑠璃色",
0x27477a: u"瑠璃紺",
0x343d55: u"紺色",
0x435aa0: u"杜若色",
0x3a3c4f: u"勝色",
0x384d98: u"群青色",
0x292934: u"鉄紺",
0x69639a: u"藤納戸",
0x4347a2: u"桔梗色",
0x353573: u"紺藍",
0xa294c8: u"藤色",
0x9883c9: u"藤紫",
0x7445aa: u"青紫",
0x714c99: u"菫色",
0x665971: u"鳩羽色",
0x744b98: u"菖蒲色",
0x614876: u"江戸紫",
0xa757a8: u"紫",
0x765276: u"古代紫",
0x473946: u"茄子紺",
0x422c41: u"紫紺",
0xc573b2: u"菖蒲色",
0xc94093: u"牡丹色",
0xda508f: u"赤紫",
0xf0f0f0: u"白",
0xebe7e1: u"胡粉色",
0xeae0d5: u"生成り色",
0xded2bf: u"象牙色",
0x9c9c9c: u"銀鼠",
0x998d86: u"茶鼠",
0x838383: u"鼠色",
0x6e7972: u"利休鼠",
0x72777d: u"鉛色",
0x767676: u"灰色",
0x5d5245: u"煤竹色",
0x3e312b: u"黒茶",
0x343434: u"墨",
0x2a2a2a: u"黒",
0x2a2a2a: u"鉄黒",
}
COLOR_KEYS = COLORS.keys()
COLOR_KEYS.sort()
def get_color(key):
head = 0
tail = len(COLOR_KEYS)
while head < tail:
mid = (head + tail) / 2
v = COLOR_KEYS[mid]
if key > v:
head = mid + 1
elif key < v:
tail = mid - 1
else:
head = mid
break
return COLORS[COLOR_KEYS[head]]