]> git.cworth.org Git - zombocom-ai/blob - interpret-cairo-to-svg.py
de296f5288d02a3d538a63fd06235ff772fc6538
[zombocom-ai] / interpret-cairo-to-svg.py
1 #!/usr/bin/env python3
2
3 import cairo
4 import tempfile
5 import os
6 import sys
7
8 import math
9 import random as rand
10
11 # Some convenience things for the program to use
12 pi = math.pi
13 random = rand.random
14
15 OUTPUT_DIR_PREFIX='/srv/cworth.org/zombocom'
16 OUTPUT_DIR="{}/busart".format(OUTPUT_DIR_PREFIX)
17
18 input = sys.stdin.read()
19
20 # Do at least a modicum of a safety check
21 if "import" in input:
22     sys.stderr.write("Error: Cowardly refusing to interpret script with 'import'")
23     sys.exit(1)
24
25 (fd, filename) = tempfile.mkstemp(suffix=".svg", prefix="busart", dir=OUTPUT_DIR);
26 os.close(fd)
27 os.chmod(filename, 0o644);
28
29 # Also delete our import for some more safety
30 del tempfile
31 del os
32 del sys
33
34 # Note: We'll let the following "safe" imports remain:
35 #
36 # math
37 # random
38
39 COLORS = {
40     'alice blue': (0xf0/0xff, 0xf8/0xff, 0xff/0xff),
41     'aliceblue': (0xf0/0xff, 0xf8/0xff, 0xff/0xff),
42     'antique white': (0xfa/0xff, 0xeb/0xff, 0xd7/0xff),
43     'antiquewhite': (0xfa/0xff, 0xeb/0xff, 0xd7/0xff),
44     'antiquewhite1': (0xff/0xff, 0xef/0xff, 0xdb/0xff),
45     'antiquewhite2': (0xee/0xff, 0xdf/0xff, 0xcc/0xff),
46     'antiquewhite3': (0xcd/0xff, 0xc0/0xff, 0xb0/0xff),
47     'antiquewhite4': (0x8b/0xff, 0x83/0xff, 0x78/0xff),
48     'aquamarine': (0x7f/0xff, 0xff/0xff, 0xd4/0xff),
49     'aquamarine1': (0x7f/0xff, 0xff/0xff, 0xd4/0xff),
50     'aquamarine2': (0x76/0xff, 0xee/0xff, 0xc6/0xff),
51     'aquamarine3': (0x66/0xff, 0xcd/0xff, 0xaa/0xff),
52     'aquamarine4': (0x45/0xff, 0x8b/0xff, 0x74/0xff),
53     'azure': (0xf0/0xff, 0xff/0xff, 0xff/0xff),
54     'azure1': (0xf0/0xff, 0xff/0xff, 0xff/0xff),
55     'azure2': (0xe0/0xff, 0xee/0xff, 0xee/0xff),
56     'azure3': (0xc1/0xff, 0xcd/0xff, 0xcd/0xff),
57     'azure4': (0x83/0xff, 0x8b/0xff, 0x8b/0xff),
58     'beige': (0xf5/0xff, 0xf5/0xff, 0xdc/0xff),
59     'bisque': (0xff/0xff, 0xe4/0xff, 0xc4/0xff),
60     'bisque1': (0xff/0xff, 0xe4/0xff, 0xc4/0xff),
61     'bisque2': (0xee/0xff, 0xd5/0xff, 0xb7/0xff),
62     'bisque3': (0xcd/0xff, 0xb7/0xff, 0x9e/0xff),
63     'bisque4': (0x8b/0xff, 0x7d/0xff, 0x6b/0xff),
64     'black': (0x00/0xff, 0x00/0xff, 0x00/0xff),
65     'blanched almond': (0xff/0xff, 0xeb/0xff, 0xcd/0xff),
66     'blanchedalmond': (0xff/0xff, 0xeb/0xff, 0xcd/0xff),
67     'blue': (0x00/0xff, 0x00/0xff, 0xff/0xff),
68     'blue violet': (0x8a/0xff, 0x2b/0xff, 0xe2/0xff),
69     'blue1': (0x00/0xff, 0x00/0xff, 0xff/0xff),
70     'blue2': (0x00/0xff, 0x00/0xff, 0xee/0xff),
71     'blue3': (0x00/0xff, 0x00/0xff, 0xcd/0xff),
72     'blue4': (0x00/0xff, 0x00/0xff, 0x8b/0xff),
73     'blueviolet': (0x8a/0xff, 0x2b/0xff, 0xe2/0xff),
74     'brown': (0xa5/0xff, 0x2a/0xff, 0x2a/0xff),
75     'brown1': (0xff/0xff, 0x40/0xff, 0x40/0xff),
76     'brown2': (0xee/0xff, 0x3b/0xff, 0x3b/0xff),
77     'brown3': (0xcd/0xff, 0x33/0xff, 0x33/0xff),
78     'brown4': (0x8b/0xff, 0x23/0xff, 0x23/0xff),
79     'burlywood': (0xde/0xff, 0xb8/0xff, 0x87/0xff),
80     'burlywood1': (0xff/0xff, 0xd3/0xff, 0x9b/0xff),
81     'burlywood2': (0xee/0xff, 0xc5/0xff, 0x91/0xff),
82     'burlywood3': (0xcd/0xff, 0xaa/0xff, 0x7d/0xff),
83     'burlywood4': (0x8b/0xff, 0x73/0xff, 0x55/0xff),
84     'cadet blue': (0x5f/0xff, 0x9e/0xff, 0xa0/0xff),
85     'cadetblue': (0x5f/0xff, 0x9e/0xff, 0xa0/0xff),
86     'cadetblue1': (0x98/0xff, 0xf5/0xff, 0xff/0xff),
87     'cadetblue2': (0x8e/0xff, 0xe5/0xff, 0xee/0xff),
88     'cadetblue3': (0x7a/0xff, 0xc5/0xff, 0xcd/0xff),
89     'cadetblue4': (0x53/0xff, 0x86/0xff, 0x8b/0xff),
90     'chartreuse': (0x7f/0xff, 0xff/0xff, 0x00/0xff),
91     'chartreuse1': (0x7f/0xff, 0xff/0xff, 0x00/0xff),
92     'chartreuse2': (0x76/0xff, 0xee/0xff, 0x00/0xff),
93     'chartreuse3': (0x66/0xff, 0xcd/0xff, 0x00/0xff),
94     'chartreuse4': (0x45/0xff, 0x8b/0xff, 0x00/0xff),
95     'chocolate': (0xd2/0xff, 0x69/0xff, 0x1e/0xff),
96     'chocolate1': (0xff/0xff, 0x7f/0xff, 0x24/0xff),
97     'chocolate2': (0xee/0xff, 0x76/0xff, 0x21/0xff),
98     'chocolate3': (0xcd/0xff, 0x66/0xff, 0x1d/0xff),
99     'chocolate4': (0x8b/0xff, 0x45/0xff, 0x13/0xff),
100     'coral': (0xff/0xff, 0x7f/0xff, 0x50/0xff),
101     'coral1': (0xff/0xff, 0x72/0xff, 0x56/0xff),
102     'coral2': (0xee/0xff, 0x6a/0xff, 0x50/0xff),
103     'coral3': (0xcd/0xff, 0x5b/0xff, 0x45/0xff),
104     'coral4': (0x8b/0xff, 0x3e/0xff, 0x2f/0xff),
105     'cornflower blue': (0x64/0xff, 0x95/0xff, 0xed/0xff),
106     'cornflowerblue': (0x64/0xff, 0x95/0xff, 0xed/0xff),
107     'cornsilk': (0xff/0xff, 0xf8/0xff, 0xdc/0xff),
108     'cornsilk1': (0xff/0xff, 0xf8/0xff, 0xdc/0xff),
109     'cornsilk2': (0xee/0xff, 0xe8/0xff, 0xcd/0xff),
110     'cornsilk3': (0xcd/0xff, 0xc8/0xff, 0xb1/0xff),
111     'cornsilk4': (0x8b/0xff, 0x88/0xff, 0x78/0xff),
112     'cyan': (0x00/0xff, 0xff/0xff, 0xff/0xff),
113     'cyan1': (0x00/0xff, 0xff/0xff, 0xff/0xff),
114     'cyan2': (0x00/0xff, 0xee/0xff, 0xee/0xff),
115     'cyan3': (0x00/0xff, 0xcd/0xff, 0xcd/0xff),
116     'cyan4': (0x00/0xff, 0x8b/0xff, 0x8b/0xff),
117     'dark blue': (0x00/0xff, 0x00/0xff, 0x8b/0xff),
118     'dark cyan': (0x00/0xff, 0x8b/0xff, 0x8b/0xff),
119     'dark goldenrod': (0xb8/0xff, 0x86/0xff, 0x0b/0xff),
120     'dark gray': (0xa9/0xff, 0xa9/0xff, 0xa9/0xff),
121     'dark green': (0x00/0xff, 0x64/0xff, 0x00/0xff),
122     'dark grey': (0xa9/0xff, 0xa9/0xff, 0xa9/0xff),
123     'dark khaki': (0xbd/0xff, 0xb7/0xff, 0x6b/0xff),
124     'dark magenta': (0x8b/0xff, 0x00/0xff, 0x8b/0xff),
125     'dark olive green': (0x55/0xff, 0x6b/0xff, 0x2f/0xff),
126     'dark orange': (0xff/0xff, 0x8c/0xff, 0x00/0xff),
127     'dark orchid': (0x99/0xff, 0x32/0xff, 0xcc/0xff),
128     'dark red': (0x8b/0xff, 0x00/0xff, 0x00/0xff),
129     'dark salmon': (0xe9/0xff, 0x96/0xff, 0x7a/0xff),
130     'dark sea green': (0x8f/0xff, 0xbc/0xff, 0x8f/0xff),
131     'dark slate blue': (0x48/0xff, 0x3d/0xff, 0x8b/0xff),
132     'dark slate gray': (0x2f/0xff, 0x4f/0xff, 0x4f/0xff),
133     'dark slate grey': (0x2f/0xff, 0x4f/0xff, 0x4f/0xff),
134     'dark turquoise': (0x00/0xff, 0xce/0xff, 0xd1/0xff),
135     'dark violet': (0x94/0xff, 0x00/0xff, 0xd3/0xff),
136     'darkblue': (0x00/0xff, 0x00/0xff, 0x8b/0xff),
137     'darkcyan': (0x00/0xff, 0x8b/0xff, 0x8b/0xff),
138     'darkgoldenrod': (0xb8/0xff, 0x86/0xff, 0x0b/0xff),
139     'darkgoldenrod1': (0xff/0xff, 0xb9/0xff, 0x0f/0xff),
140     'darkgoldenrod2': (0xee/0xff, 0xad/0xff, 0x0e/0xff),
141     'darkgoldenrod3': (0xcd/0xff, 0x95/0xff, 0x0c/0xff),
142     'darkgoldenrod4': (0x8b/0xff, 0x65/0xff, 0x08/0xff),
143     'darkgray': (0xa9/0xff, 0xa9/0xff, 0xa9/0xff),
144     'darkgreen': (0x00/0xff, 0x64/0xff, 0x00/0xff),
145     'darkgrey': (0xa9/0xff, 0xa9/0xff, 0xa9/0xff),
146     'darkkhaki': (0xbd/0xff, 0xb7/0xff, 0x6b/0xff),
147     'darkmagenta': (0x8b/0xff, 0x00/0xff, 0x8b/0xff),
148     'darkolivegreen': (0x55/0xff, 0x6b/0xff, 0x2f/0xff),
149     'darkolivegreen1': (0xca/0xff, 0xff/0xff, 0x70/0xff),
150     'darkolivegreen2': (0xbc/0xff, 0xee/0xff, 0x68/0xff),
151     'darkolivegreen3': (0xa2/0xff, 0xcd/0xff, 0x5a/0xff),
152     'darkolivegreen4': (0x6e/0xff, 0x8b/0xff, 0x3d/0xff),
153     'darkorange': (0xff/0xff, 0x8c/0xff, 0x00/0xff),
154     'darkorange1': (0xff/0xff, 0x7f/0xff, 0x00/0xff),
155     'darkorange2': (0xee/0xff, 0x76/0xff, 0x00/0xff),
156     'darkorange3': (0xcd/0xff, 0x66/0xff, 0x00/0xff),
157     'darkorange4': (0x8b/0xff, 0x45/0xff, 0x00/0xff),
158     'darkorchid': (0x99/0xff, 0x32/0xff, 0xcc/0xff),
159     'darkorchid1': (0xbf/0xff, 0x3e/0xff, 0xff/0xff),
160     'darkorchid2': (0xb2/0xff, 0x3a/0xff, 0xee/0xff),
161     'darkorchid3': (0x9a/0xff, 0x32/0xff, 0xcd/0xff),
162     'darkorchid4': (0x68/0xff, 0x22/0xff, 0x8b/0xff),
163     'darkred': (0x8b/0xff, 0x00/0xff, 0x00/0xff),
164     'darksalmon': (0xe9/0xff, 0x96/0xff, 0x7a/0xff),
165     'darkseagreen': (0x8f/0xff, 0xbc/0xff, 0x8f/0xff),
166     'darkseagreen1': (0xc1/0xff, 0xff/0xff, 0xc1/0xff),
167     'darkseagreen2': (0xb4/0xff, 0xee/0xff, 0xb4/0xff),
168     'darkseagreen3': (0x9b/0xff, 0xcd/0xff, 0x9b/0xff),
169     'darkseagreen4': (0x69/0xff, 0x8b/0xff, 0x69/0xff),
170     'darkslateblue': (0x48/0xff, 0x3d/0xff, 0x8b/0xff),
171     'darkslategray': (0x2f/0xff, 0x4f/0xff, 0x4f/0xff),
172     'darkslategray1': (0x97/0xff, 0xff/0xff, 0xff/0xff),
173     'darkslategray2': (0x8d/0xff, 0xee/0xff, 0xee/0xff),
174     'darkslategray3': (0x79/0xff, 0xcd/0xff, 0xcd/0xff),
175     'darkslategray4': (0x52/0xff, 0x8b/0xff, 0x8b/0xff),
176     'darkslategrey': (0x2f/0xff, 0x4f/0xff, 0x4f/0xff),
177     'darkturquoise': (0x00/0xff, 0xce/0xff, 0xd1/0xff),
178     'darkviolet': (0x94/0xff, 0x00/0xff, 0xd3/0xff),
179     'deep pink': (0xff/0xff, 0x14/0xff, 0x93/0xff),
180     'deep sky blue': (0x00/0xff, 0xbf/0xff, 0xff/0xff),
181     'deeppink': (0xff/0xff, 0x14/0xff, 0x93/0xff),
182     'deeppink1': (0xff/0xff, 0x14/0xff, 0x93/0xff),
183     'deeppink2': (0xee/0xff, 0x12/0xff, 0x89/0xff),
184     'deeppink3': (0xcd/0xff, 0x10/0xff, 0x76/0xff),
185     'deeppink4': (0x8b/0xff, 0x0a/0xff, 0x50/0xff),
186     'deepskyblue': (0x00/0xff, 0xbf/0xff, 0xff/0xff),
187     'deepskyblue1': (0x00/0xff, 0xbf/0xff, 0xff/0xff),
188     'deepskyblue2': (0x00/0xff, 0xb2/0xff, 0xee/0xff),
189     'deepskyblue3': (0x00/0xff, 0x9a/0xff, 0xcd/0xff),
190     'deepskyblue4': (0x00/0xff, 0x68/0xff, 0x8b/0xff),
191     'dim gray': (0x69/0xff, 0x69/0xff, 0x69/0xff),
192     'dim grey': (0x69/0xff, 0x69/0xff, 0x69/0xff),
193     'dimgray': (0x69/0xff, 0x69/0xff, 0x69/0xff),
194     'dimgrey': (0x69/0xff, 0x69/0xff, 0x69/0xff),
195     'dodger blue': (0x1e/0xff, 0x90/0xff, 0xff/0xff),
196     'dodgerblue': (0x1e/0xff, 0x90/0xff, 0xff/0xff),
197     'dodgerblue1': (0x1e/0xff, 0x90/0xff, 0xff/0xff),
198     'dodgerblue2': (0x1c/0xff, 0x86/0xff, 0xee/0xff),
199     'dodgerblue3': (0x18/0xff, 0x74/0xff, 0xcd/0xff),
200     'dodgerblue4': (0x10/0xff, 0x4e/0xff, 0x8b/0xff),
201     'firebrick': (0xb2/0xff, 0x22/0xff, 0x22/0xff),
202     'firebrick1': (0xff/0xff, 0x30/0xff, 0x30/0xff),
203     'firebrick2': (0xee/0xff, 0x2c/0xff, 0x2c/0xff),
204     'firebrick3': (0xcd/0xff, 0x26/0xff, 0x26/0xff),
205     'firebrick4': (0x8b/0xff, 0x1a/0xff, 0x1a/0xff),
206     'floral white': (0xff/0xff, 0xfa/0xff, 0xf0/0xff),
207     'floralwhite': (0xff/0xff, 0xfa/0xff, 0xf0/0xff),
208     'forest green': (0x22/0xff, 0x8b/0xff, 0x22/0xff),
209     'forestgreen': (0x22/0xff, 0x8b/0xff, 0x22/0xff),
210     'gainsboro': (0xdc/0xff, 0xdc/0xff, 0xdc/0xff),
211     'ghost white': (0xf8/0xff, 0xf8/0xff, 0xff/0xff),
212     'ghostwhite': (0xf8/0xff, 0xf8/0xff, 0xff/0xff),
213     'gold': (0xff/0xff, 0xd7/0xff, 0x00/0xff),
214     'gold1': (0xff/0xff, 0xd7/0xff, 0x00/0xff),
215     'gold2': (0xee/0xff, 0xc9/0xff, 0x00/0xff),
216     'gold3': (0xcd/0xff, 0xad/0xff, 0x00/0xff),
217     'gold4': (0x8b/0xff, 0x75/0xff, 0x00/0xff),
218     'goldenrod': (0xda/0xff, 0xa5/0xff, 0x20/0xff),
219     'goldenrod1': (0xff/0xff, 0xc1/0xff, 0x25/0xff),
220     'goldenrod2': (0xee/0xff, 0xb4/0xff, 0x22/0xff),
221     'goldenrod3': (0xcd/0xff, 0x9b/0xff, 0x1d/0xff),
222     'goldenrod4': (0x8b/0xff, 0x69/0xff, 0x14/0xff),
223     'gray': (0x80/0xff, 0x80/0xff, 0x80/0xff),
224     'gray0': (0x00/0xff, 0x00/0xff, 0x00/0xff),
225     'gray1': (0x03/0xff, 0x03/0xff, 0x03/0xff),
226     'gray2': (0x05/0xff, 0x05/0xff, 0x05/0xff),
227     'gray3': (0x08/0xff, 0x08/0xff, 0x08/0xff),
228     'gray4': (0x0a/0xff, 0x0a/0xff, 0x0a/0xff),
229     'gray5': (0x0d/0xff, 0x0d/0xff, 0x0d/0xff),
230     'gray6': (0x0f/0xff, 0x0f/0xff, 0x0f/0xff),
231     'gray7': (0x12/0xff, 0x12/0xff, 0x12/0xff),
232     'gray8': (0x14/0xff, 0x14/0xff, 0x14/0xff),
233     'gray9': (0x17/0xff, 0x17/0xff, 0x17/0xff),
234     'gray10': (0x1a/0xff, 0x1a/0xff, 0x1a/0xff),
235     'gray11': (0x1c/0xff, 0x1c/0xff, 0x1c/0xff),
236     'gray12': (0x1f/0xff, 0x1f/0xff, 0x1f/0xff),
237     'gray13': (0x21/0xff, 0x21/0xff, 0x21/0xff),
238     'gray14': (0x24/0xff, 0x24/0xff, 0x24/0xff),
239     'gray15': (0x26/0xff, 0x26/0xff, 0x26/0xff),
240     'gray16': (0x29/0xff, 0x29/0xff, 0x29/0xff),
241     'gray17': (0x2b/0xff, 0x2b/0xff, 0x2b/0xff),
242     'gray18': (0x2e/0xff, 0x2e/0xff, 0x2e/0xff),
243     'gray19': (0x30/0xff, 0x30/0xff, 0x30/0xff),
244     'gray20': (0x33/0xff, 0x33/0xff, 0x33/0xff),
245     'gray21': (0x36/0xff, 0x36/0xff, 0x36/0xff),
246     'gray22': (0x38/0xff, 0x38/0xff, 0x38/0xff),
247     'gray23': (0x3b/0xff, 0x3b/0xff, 0x3b/0xff),
248     'gray24': (0x3d/0xff, 0x3d/0xff, 0x3d/0xff),
249     'gray25': (0x40/0xff, 0x40/0xff, 0x40/0xff),
250     'gray26': (0x42/0xff, 0x42/0xff, 0x42/0xff),
251     'gray27': (0x45/0xff, 0x45/0xff, 0x45/0xff),
252     'gray28': (0x47/0xff, 0x47/0xff, 0x47/0xff),
253     'gray29': (0x4a/0xff, 0x4a/0xff, 0x4a/0xff),
254     'gray30': (0x4d/0xff, 0x4d/0xff, 0x4d/0xff),
255     'gray31': (0x4f/0xff, 0x4f/0xff, 0x4f/0xff),
256     'gray32': (0x52/0xff, 0x52/0xff, 0x52/0xff),
257     'gray33': (0x54/0xff, 0x54/0xff, 0x54/0xff),
258     'gray34': (0x57/0xff, 0x57/0xff, 0x57/0xff),
259     'gray35': (0x59/0xff, 0x59/0xff, 0x59/0xff),
260     'gray36': (0x5c/0xff, 0x5c/0xff, 0x5c/0xff),
261     'gray37': (0x5e/0xff, 0x5e/0xff, 0x5e/0xff),
262     'gray38': (0x61/0xff, 0x61/0xff, 0x61/0xff),
263     'gray39': (0x63/0xff, 0x63/0xff, 0x63/0xff),
264     'gray40': (0x66/0xff, 0x66/0xff, 0x66/0xff),
265     'gray41': (0x69/0xff, 0x69/0xff, 0x69/0xff),
266     'gray42': (0x6b/0xff, 0x6b/0xff, 0x6b/0xff),
267     'gray43': (0x6e/0xff, 0x6e/0xff, 0x6e/0xff),
268     'gray44': (0x70/0xff, 0x70/0xff, 0x70/0xff),
269     'gray45': (0x73/0xff, 0x73/0xff, 0x73/0xff),
270     'gray46': (0x75/0xff, 0x75/0xff, 0x75/0xff),
271     'gray47': (0x78/0xff, 0x78/0xff, 0x78/0xff),
272     'gray48': (0x7a/0xff, 0x7a/0xff, 0x7a/0xff),
273     'gray49': (0x7d/0xff, 0x7d/0xff, 0x7d/0xff),
274     'gray50': (0x7f/0xff, 0x7f/0xff, 0x7f/0xff),
275     'gray51': (0x82/0xff, 0x82/0xff, 0x82/0xff),
276     'gray52': (0x85/0xff, 0x85/0xff, 0x85/0xff),
277     'gray53': (0x87/0xff, 0x87/0xff, 0x87/0xff),
278     'gray54': (0x8a/0xff, 0x8a/0xff, 0x8a/0xff),
279     'gray55': (0x8c/0xff, 0x8c/0xff, 0x8c/0xff),
280     'gray56': (0x8f/0xff, 0x8f/0xff, 0x8f/0xff),
281     'gray57': (0x91/0xff, 0x91/0xff, 0x91/0xff),
282     'gray58': (0x94/0xff, 0x94/0xff, 0x94/0xff),
283     'gray59': (0x96/0xff, 0x96/0xff, 0x96/0xff),
284     'gray60': (0x99/0xff, 0x99/0xff, 0x99/0xff),
285     'gray61': (0x9c/0xff, 0x9c/0xff, 0x9c/0xff),
286     'gray62': (0x9e/0xff, 0x9e/0xff, 0x9e/0xff),
287     'gray63': (0xa1/0xff, 0xa1/0xff, 0xa1/0xff),
288     'gray64': (0xa3/0xff, 0xa3/0xff, 0xa3/0xff),
289     'gray65': (0xa6/0xff, 0xa6/0xff, 0xa6/0xff),
290     'gray66': (0xa8/0xff, 0xa8/0xff, 0xa8/0xff),
291     'gray67': (0xab/0xff, 0xab/0xff, 0xab/0xff),
292     'gray68': (0xad/0xff, 0xad/0xff, 0xad/0xff),
293     'gray69': (0xb0/0xff, 0xb0/0xff, 0xb0/0xff),
294     'gray70': (0xb3/0xff, 0xb3/0xff, 0xb3/0xff),
295     'gray71': (0xb5/0xff, 0xb5/0xff, 0xb5/0xff),
296     'gray72': (0xb8/0xff, 0xb8/0xff, 0xb8/0xff),
297     'gray73': (0xba/0xff, 0xba/0xff, 0xba/0xff),
298     'gray74': (0xbd/0xff, 0xbd/0xff, 0xbd/0xff),
299     'gray75': (0xbf/0xff, 0xbf/0xff, 0xbf/0xff),
300     'gray76': (0xc2/0xff, 0xc2/0xff, 0xc2/0xff),
301     'gray77': (0xc4/0xff, 0xc4/0xff, 0xc4/0xff),
302     'gray78': (0xc7/0xff, 0xc7/0xff, 0xc7/0xff),
303     'gray79': (0xc9/0xff, 0xc9/0xff, 0xc9/0xff),
304     'gray80': (0xcc/0xff, 0xcc/0xff, 0xcc/0xff),
305     'gray81': (0xcf/0xff, 0xcf/0xff, 0xcf/0xff),
306     'gray82': (0xd1/0xff, 0xd1/0xff, 0xd1/0xff),
307     'gray83': (0xd4/0xff, 0xd4/0xff, 0xd4/0xff),
308     'gray84': (0xd6/0xff, 0xd6/0xff, 0xd6/0xff),
309     'gray85': (0xd9/0xff, 0xd9/0xff, 0xd9/0xff),
310     'gray86': (0xdb/0xff, 0xdb/0xff, 0xdb/0xff),
311     'gray87': (0xde/0xff, 0xde/0xff, 0xde/0xff),
312     'gray88': (0xe0/0xff, 0xe0/0xff, 0xe0/0xff),
313     'gray89': (0xe3/0xff, 0xe3/0xff, 0xe3/0xff),
314     'gray90': (0xe5/0xff, 0xe5/0xff, 0xe5/0xff),
315     'gray91': (0xe8/0xff, 0xe8/0xff, 0xe8/0xff),
316     'gray92': (0xeb/0xff, 0xeb/0xff, 0xeb/0xff),
317     'gray93': (0xed/0xff, 0xed/0xff, 0xed/0xff),
318     'gray94': (0xf0/0xff, 0xf0/0xff, 0xf0/0xff),
319     'gray95': (0xf2/0xff, 0xf2/0xff, 0xf2/0xff),
320     'gray96': (0xf5/0xff, 0xf5/0xff, 0xf5/0xff),
321     'gray97': (0xf7/0xff, 0xf7/0xff, 0xf7/0xff),
322     'gray98': (0xfa/0xff, 0xfa/0xff, 0xfa/0xff),
323     'gray99': (0xfc/0xff, 0xfc/0xff, 0xfc/0xff),
324     'gray100': (0xff/0xff, 0xff/0xff, 0xff/0xff),
325     'green': (0x00/0xff, 0x80/0xff, 0x00/0xff),
326     'green yellow': (0xad/0xff, 0xff/0xff, 0x2f/0xff),
327     'green1': (0x00/0xff, 0xff/0xff, 0x00/0xff),
328     'green2': (0x00/0xff, 0xee/0xff, 0x00/0xff),
329     'green3': (0x00/0xff, 0xcd/0xff, 0x00/0xff),
330     'green4': (0x00/0xff, 0x8b/0xff, 0x00/0xff),
331     'greenyellow': (0xad/0xff, 0xff/0xff, 0x2f/0xff),
332     'grey': (0x80/0xff, 0x80/0xff, 0x80/0xff),
333     'grey0': (0x00/0xff, 0x00/0xff, 0x00/0xff),
334     'grey1': (0x03/0xff, 0x03/0xff, 0x03/0xff),
335     'grey2': (0x05/0xff, 0x05/0xff, 0x05/0xff),
336     'grey3': (0x08/0xff, 0x08/0xff, 0x08/0xff),
337     'grey4': (0x0a/0xff, 0x0a/0xff, 0x0a/0xff),
338     'grey5': (0x0d/0xff, 0x0d/0xff, 0x0d/0xff),
339     'grey6': (0x0f/0xff, 0x0f/0xff, 0x0f/0xff),
340     'grey7': (0x12/0xff, 0x12/0xff, 0x12/0xff),
341     'grey8': (0x14/0xff, 0x14/0xff, 0x14/0xff),
342     'grey9': (0x17/0xff, 0x17/0xff, 0x17/0xff),
343     'grey10': (0x1a/0xff, 0x1a/0xff, 0x1a/0xff),
344     'grey11': (0x1c/0xff, 0x1c/0xff, 0x1c/0xff),
345     'grey12': (0x1f/0xff, 0x1f/0xff, 0x1f/0xff),
346     'grey13': (0x21/0xff, 0x21/0xff, 0x21/0xff),
347     'grey14': (0x24/0xff, 0x24/0xff, 0x24/0xff),
348     'grey15': (0x26/0xff, 0x26/0xff, 0x26/0xff),
349     'grey16': (0x29/0xff, 0x29/0xff, 0x29/0xff),
350     'grey17': (0x2b/0xff, 0x2b/0xff, 0x2b/0xff),
351     'grey18': (0x2e/0xff, 0x2e/0xff, 0x2e/0xff),
352     'grey19': (0x30/0xff, 0x30/0xff, 0x30/0xff),
353     'grey20': (0x33/0xff, 0x33/0xff, 0x33/0xff),
354     'grey21': (0x36/0xff, 0x36/0xff, 0x36/0xff),
355     'grey22': (0x38/0xff, 0x38/0xff, 0x38/0xff),
356     'grey23': (0x3b/0xff, 0x3b/0xff, 0x3b/0xff),
357     'grey24': (0x3d/0xff, 0x3d/0xff, 0x3d/0xff),
358     'grey25': (0x40/0xff, 0x40/0xff, 0x40/0xff),
359     'grey26': (0x42/0xff, 0x42/0xff, 0x42/0xff),
360     'grey27': (0x45/0xff, 0x45/0xff, 0x45/0xff),
361     'grey28': (0x47/0xff, 0x47/0xff, 0x47/0xff),
362     'grey29': (0x4a/0xff, 0x4a/0xff, 0x4a/0xff),
363     'grey30': (0x4d/0xff, 0x4d/0xff, 0x4d/0xff),
364     'grey31': (0x4f/0xff, 0x4f/0xff, 0x4f/0xff),
365     'grey32': (0x52/0xff, 0x52/0xff, 0x52/0xff),
366     'grey33': (0x54/0xff, 0x54/0xff, 0x54/0xff),
367     'grey34': (0x57/0xff, 0x57/0xff, 0x57/0xff),
368     'grey35': (0x59/0xff, 0x59/0xff, 0x59/0xff),
369     'grey36': (0x5c/0xff, 0x5c/0xff, 0x5c/0xff),
370     'grey37': (0x5e/0xff, 0x5e/0xff, 0x5e/0xff),
371     'grey38': (0x61/0xff, 0x61/0xff, 0x61/0xff),
372     'grey39': (0x63/0xff, 0x63/0xff, 0x63/0xff),
373     'grey40': (0x66/0xff, 0x66/0xff, 0x66/0xff),
374     'grey41': (0x69/0xff, 0x69/0xff, 0x69/0xff),
375     'grey42': (0x6b/0xff, 0x6b/0xff, 0x6b/0xff),
376     'grey43': (0x6e/0xff, 0x6e/0xff, 0x6e/0xff),
377     'grey44': (0x70/0xff, 0x70/0xff, 0x70/0xff),
378     'grey45': (0x73/0xff, 0x73/0xff, 0x73/0xff),
379     'grey46': (0x75/0xff, 0x75/0xff, 0x75/0xff),
380     'grey47': (0x78/0xff, 0x78/0xff, 0x78/0xff),
381     'grey48': (0x7a/0xff, 0x7a/0xff, 0x7a/0xff),
382     'grey49': (0x7d/0xff, 0x7d/0xff, 0x7d/0xff),
383     'grey50': (0x7f/0xff, 0x7f/0xff, 0x7f/0xff),
384     'grey51': (0x82/0xff, 0x82/0xff, 0x82/0xff),
385     'grey52': (0x85/0xff, 0x85/0xff, 0x85/0xff),
386     'grey53': (0x87/0xff, 0x87/0xff, 0x87/0xff),
387     'grey54': (0x8a/0xff, 0x8a/0xff, 0x8a/0xff),
388     'grey55': (0x8c/0xff, 0x8c/0xff, 0x8c/0xff),
389     'grey56': (0x8f/0xff, 0x8f/0xff, 0x8f/0xff),
390     'grey57': (0x91/0xff, 0x91/0xff, 0x91/0xff),
391     'grey58': (0x94/0xff, 0x94/0xff, 0x94/0xff),
392     'grey59': (0x96/0xff, 0x96/0xff, 0x96/0xff),
393     'grey60': (0x99/0xff, 0x99/0xff, 0x99/0xff),
394     'grey61': (0x9c/0xff, 0x9c/0xff, 0x9c/0xff),
395     'grey62': (0x9e/0xff, 0x9e/0xff, 0x9e/0xff),
396     'grey63': (0xa1/0xff, 0xa1/0xff, 0xa1/0xff),
397     'grey64': (0xa3/0xff, 0xa3/0xff, 0xa3/0xff),
398     'grey65': (0xa6/0xff, 0xa6/0xff, 0xa6/0xff),
399     'grey66': (0xa8/0xff, 0xa8/0xff, 0xa8/0xff),
400     'grey67': (0xab/0xff, 0xab/0xff, 0xab/0xff),
401     'grey68': (0xad/0xff, 0xad/0xff, 0xad/0xff),
402     'grey69': (0xb0/0xff, 0xb0/0xff, 0xb0/0xff),
403     'grey70': (0xb3/0xff, 0xb3/0xff, 0xb3/0xff),
404     'grey71': (0xb5/0xff, 0xb5/0xff, 0xb5/0xff),
405     'grey72': (0xb8/0xff, 0xb8/0xff, 0xb8/0xff),
406     'grey73': (0xba/0xff, 0xba/0xff, 0xba/0xff),
407     'grey74': (0xbd/0xff, 0xbd/0xff, 0xbd/0xff),
408     'grey75': (0xbf/0xff, 0xbf/0xff, 0xbf/0xff),
409     'grey76': (0xc2/0xff, 0xc2/0xff, 0xc2/0xff),
410     'grey77': (0xc4/0xff, 0xc4/0xff, 0xc4/0xff),
411     'grey78': (0xc7/0xff, 0xc7/0xff, 0xc7/0xff),
412     'grey79': (0xc9/0xff, 0xc9/0xff, 0xc9/0xff),
413     'grey80': (0xcc/0xff, 0xcc/0xff, 0xcc/0xff),
414     'grey81': (0xcf/0xff, 0xcf/0xff, 0xcf/0xff),
415     'grey82': (0xd1/0xff, 0xd1/0xff, 0xd1/0xff),
416     'grey83': (0xd4/0xff, 0xd4/0xff, 0xd4/0xff),
417     'grey84': (0xd6/0xff, 0xd6/0xff, 0xd6/0xff),
418     'grey85': (0xd9/0xff, 0xd9/0xff, 0xd9/0xff),
419     'grey86': (0xdb/0xff, 0xdb/0xff, 0xdb/0xff),
420     'grey87': (0xde/0xff, 0xde/0xff, 0xde/0xff),
421     'grey88': (0xe0/0xff, 0xe0/0xff, 0xe0/0xff),
422     'grey89': (0xe3/0xff, 0xe3/0xff, 0xe3/0xff),
423     'grey90': (0xe5/0xff, 0xe5/0xff, 0xe5/0xff),
424     'grey91': (0xe8/0xff, 0xe8/0xff, 0xe8/0xff),
425     'grey92': (0xeb/0xff, 0xeb/0xff, 0xeb/0xff),
426     'grey93': (0xed/0xff, 0xed/0xff, 0xed/0xff),
427     'grey94': (0xf0/0xff, 0xf0/0xff, 0xf0/0xff),
428     'grey95': (0xf2/0xff, 0xf2/0xff, 0xf2/0xff),
429     'grey96': (0xf5/0xff, 0xf5/0xff, 0xf5/0xff),
430     'grey97': (0xf7/0xff, 0xf7/0xff, 0xf7/0xff),
431     'grey98': (0xfa/0xff, 0xfa/0xff, 0xfa/0xff),
432     'grey99': (0xfc/0xff, 0xfc/0xff, 0xfc/0xff),
433     'grey100': (0xff/0xff, 0xff/0xff, 0xff/0xff),
434     'honeydew': (0xf0/0xff, 0xff/0xff, 0xf0/0xff),
435     'honeydew1': (0xf0/0xff, 0xff/0xff, 0xf0/0xff),
436     'honeydew2': (0xe0/0xff, 0xee/0xff, 0xe0/0xff),
437     'honeydew3': (0xc1/0xff, 0xcd/0xff, 0xc1/0xff),
438     'honeydew4': (0x83/0xff, 0x8b/0xff, 0x83/0xff),
439     'hot pink': (0xff/0xff, 0x69/0xff, 0xb4/0xff),
440     'hotpink': (0xff/0xff, 0x69/0xff, 0xb4/0xff),
441     'hotpink1': (0xff/0xff, 0x6e/0xff, 0xb4/0xff),
442     'hotpink2': (0xee/0xff, 0x6a/0xff, 0xa7/0xff),
443     'hotpink3': (0xcd/0xff, 0x60/0xff, 0x90/0xff),
444     'hotpink4': (0x8b/0xff, 0x3a/0xff, 0x62/0xff),
445     'indian red': (0xcd/0xff, 0x5c/0xff, 0x5c/0xff),
446     'indianred': (0xcd/0xff, 0x5c/0xff, 0x5c/0xff),
447     'indianred1': (0xff/0xff, 0x6a/0xff, 0x6a/0xff),
448     'indianred2': (0xee/0xff, 0x63/0xff, 0x63/0xff),
449     'indianred3': (0xcd/0xff, 0x55/0xff, 0x55/0xff),
450     'indianred4': (0x8b/0xff, 0x3a/0xff, 0x3a/0xff),
451     'ivory': (0xff/0xff, 0xff/0xff, 0xf0/0xff),
452     'ivory1': (0xff/0xff, 0xff/0xff, 0xf0/0xff),
453     'ivory2': (0xee/0xff, 0xee/0xff, 0xe0/0xff),
454     'ivory3': (0xcd/0xff, 0xcd/0xff, 0xc1/0xff),
455     'ivory4': (0x8b/0xff, 0x8b/0xff, 0x83/0xff),
456     'khaki': (0xf0/0xff, 0xe6/0xff, 0x8c/0xff),
457     'khaki1': (0xff/0xff, 0xf6/0xff, 0x8f/0xff),
458     'khaki2': (0xee/0xff, 0xe6/0xff, 0x85/0xff),
459     'khaki3': (0xcd/0xff, 0xc6/0xff, 0x73/0xff),
460     'khaki4': (0x8b/0xff, 0x86/0xff, 0x4e/0xff),
461     'lavender': (0xe6/0xff, 0xe6/0xff, 0xfa/0xff),
462     'lavender blush': (0xff/0xff, 0xf0/0xff, 0xf5/0xff),
463     'lavenderblush': (0xff/0xff, 0xf0/0xff, 0xf5/0xff),
464     'lavenderblush1': (0xff/0xff, 0xf0/0xff, 0xf5/0xff),
465     'lavenderblush2': (0xee/0xff, 0xe0/0xff, 0xe5/0xff),
466     'lavenderblush3': (0xcd/0xff, 0xc1/0xff, 0xc5/0xff),
467     'lavenderblush4': (0x8b/0xff, 0x83/0xff, 0x86/0xff),
468     'lawn green': (0x7c/0xff, 0xfc/0xff, 0x00/0xff),
469     'lawngreen': (0x7c/0xff, 0xfc/0xff, 0x00/0xff),
470     'lemon chiffon': (0xff/0xff, 0xfa/0xff, 0xcd/0xff),
471     'lemonchiffon': (0xff/0xff, 0xfa/0xff, 0xcd/0xff),
472     'lemonchiffon1': (0xff/0xff, 0xfa/0xff, 0xcd/0xff),
473     'lemonchiffon2': (0xee/0xff, 0xe9/0xff, 0xbf/0xff),
474     'lemonchiffon3': (0xcd/0xff, 0xc9/0xff, 0xa5/0xff),
475     'lemonchiffon4': (0x8b/0xff, 0x89/0xff, 0x70/0xff),
476     'light blue': (0xad/0xff, 0xd8/0xff, 0xe6/0xff),
477     'light coral': (0xf0/0xff, 0x80/0xff, 0x80/0xff),
478     'light cyan': (0xe0/0xff, 0xff/0xff, 0xff/0xff),
479     'light goldenrod': (0xee/0xff, 0xdd/0xff, 0x82/0xff),
480     'light goldenrod yellow': (0xfa/0xff, 0xfa/0xff, 0xd2/0xff),
481     'light gray': (0xd3/0xff, 0xd3/0xff, 0xd3/0xff),
482     'light green': (0x90/0xff, 0xee/0xff, 0x90/0xff),
483     'light grey': (0xd3/0xff, 0xd3/0xff, 0xd3/0xff),
484     'light pink': (0xff/0xff, 0xb6/0xff, 0xc1/0xff),
485     'light salmon': (0xff/0xff, 0xa0/0xff, 0x7a/0xff),
486     'light sea green': (0x20/0xff, 0xb2/0xff, 0xaa/0xff),
487     'light sky blue': (0x87/0xff, 0xce/0xff, 0xfa/0xff),
488     'light slate blue': (0x84/0xff, 0x70/0xff, 0xff/0xff),
489     'light slate gray': (0x77/0xff, 0x88/0xff, 0x99/0xff),
490     'light slate grey': (0x77/0xff, 0x88/0xff, 0x99/0xff),
491     'light steel blue': (0xb0/0xff, 0xc4/0xff, 0xde/0xff),
492     'light yellow': (0xff/0xff, 0xff/0xff, 0xe0/0xff),
493     'lightblue': (0xad/0xff, 0xd8/0xff, 0xe6/0xff),
494     'lightblue1': (0xbf/0xff, 0xef/0xff, 0xff/0xff),
495     'lightblue2': (0xb2/0xff, 0xdf/0xff, 0xee/0xff),
496     'lightblue3': (0x9a/0xff, 0xc0/0xff, 0xcd/0xff),
497     'lightblue4': (0x68/0xff, 0x83/0xff, 0x8b/0xff),
498     'lightcoral': (0xf0/0xff, 0x80/0xff, 0x80/0xff),
499     'lightcyan': (0xe0/0xff, 0xff/0xff, 0xff/0xff),
500     'lightcyan1': (0xe0/0xff, 0xff/0xff, 0xff/0xff),
501     'lightcyan2': (0xd1/0xff, 0xee/0xff, 0xee/0xff),
502     'lightcyan3': (0xb4/0xff, 0xcd/0xff, 0xcd/0xff),
503     'lightcyan4': (0x7a/0xff, 0x8b/0xff, 0x8b/0xff),
504     'lightgoldenrod': (0xee/0xff, 0xdd/0xff, 0x82/0xff),
505     'lightgoldenrod1': (0xff/0xff, 0xec/0xff, 0x8b/0xff),
506     'lightgoldenrod2': (0xee/0xff, 0xdc/0xff, 0x82/0xff),
507     'lightgoldenrod3': (0xcd/0xff, 0xbe/0xff, 0x70/0xff),
508     'lightgoldenrod4': (0x8b/0xff, 0x81/0xff, 0x4c/0xff),
509     'lightgoldenrodyellow': (0xfa/0xff, 0xfa/0xff, 0xd2/0xff),
510     'lightgray': (0xd3/0xff, 0xd3/0xff, 0xd3/0xff),
511     'lightgreen': (0x90/0xff, 0xee/0xff, 0x90/0xff),
512     'lightgrey': (0xd3/0xff, 0xd3/0xff, 0xd3/0xff),
513     'lightpink': (0xff/0xff, 0xb6/0xff, 0xc1/0xff),
514     'lightpink1': (0xff/0xff, 0xae/0xff, 0xb9/0xff),
515     'lightpink2': (0xee/0xff, 0xa2/0xff, 0xad/0xff),
516     'lightpink3': (0xcd/0xff, 0x8c/0xff, 0x95/0xff),
517     'lightpink4': (0x8b/0xff, 0x5f/0xff, 0x65/0xff),
518     'lightsalmon': (0xff/0xff, 0xa0/0xff, 0x7a/0xff),
519     'lightsalmon1': (0xff/0xff, 0xa0/0xff, 0x7a/0xff),
520     'lightsalmon2': (0xee/0xff, 0x95/0xff, 0x72/0xff),
521     'lightsalmon3': (0xcd/0xff, 0x81/0xff, 0x62/0xff),
522     'lightsalmon4': (0x8b/0xff, 0x57/0xff, 0x42/0xff),
523     'lightseagreen': (0x20/0xff, 0xb2/0xff, 0xaa/0xff),
524     'lightskyblue': (0x87/0xff, 0xce/0xff, 0xfa/0xff),
525     'lightskyblue1': (0xb0/0xff, 0xe2/0xff, 0xff/0xff),
526     'lightskyblue2': (0xa4/0xff, 0xd3/0xff, 0xee/0xff),
527     'lightskyblue3': (0x8d/0xff, 0xb6/0xff, 0xcd/0xff),
528     'lightskyblue4': (0x60/0xff, 0x7b/0xff, 0x8b/0xff),
529     'lightslateblue': (0x84/0xff, 0x70/0xff, 0xff/0xff),
530     'lightslategray': (0x77/0xff, 0x88/0xff, 0x99/0xff),
531     'lightslategrey': (0x77/0xff, 0x88/0xff, 0x99/0xff),
532     'lightsteelblue': (0xb0/0xff, 0xc4/0xff, 0xde/0xff),
533     'lightsteelblue1': (0xca/0xff, 0xe1/0xff, 0xff/0xff),
534     'lightsteelblue2': (0xbc/0xff, 0xd2/0xff, 0xee/0xff),
535     'lightsteelblue3': (0xa2/0xff, 0xb5/0xff, 0xcd/0xff),
536     'lightsteelblue4': (0x6e/0xff, 0x7b/0xff, 0x8b/0xff),
537     'lightyellow': (0xff/0xff, 0xff/0xff, 0xe0/0xff),
538     'lightyellow1': (0xff/0xff, 0xff/0xff, 0xe0/0xff),
539     'lightyellow2': (0xee/0xff, 0xee/0xff, 0xd1/0xff),
540     'lightyellow3': (0xcd/0xff, 0xcd/0xff, 0xb4/0xff),
541     'lightyellow4': (0x8b/0xff, 0x8b/0xff, 0x7a/0xff),
542     'lime green': (0x32/0xff, 0xcd/0xff, 0x32/0xff),
543     'limegreen': (0x32/0xff, 0xcd/0xff, 0x32/0xff),
544     'linen': (0xfa/0xff, 0xf0/0xff, 0xe6/0xff),
545     'magenta': (0xff/0xff, 0x00/0xff, 0xff/0xff),
546     'magenta1': (0xff/0xff, 0x00/0xff, 0xff/0xff),
547     'magenta2': (0xee/0xff, 0x00/0xff, 0xee/0xff),
548     'magenta3': (0xcd/0xff, 0x00/0xff, 0xcd/0xff),
549     'magenta4': (0x8b/0xff, 0x00/0xff, 0x8b/0xff),
550     'maroon': (0x80/0xff, 0x00/0xff, 0x00/0xff),
551     'maroon1': (0xff/0xff, 0x34/0xff, 0xb3/0xff),
552     'maroon2': (0xee/0xff, 0x30/0xff, 0xa7/0xff),
553     'maroon3': (0xcd/0xff, 0x29/0xff, 0x90/0xff),
554     'maroon4': (0x8b/0xff, 0x1c/0xff, 0x62/0xff),
555     'medium aquamarine': (0x66/0xff, 0xcd/0xff, 0xaa/0xff),
556     'medium blue': (0x00/0xff, 0x00/0xff, 0xcd/0xff),
557     'medium orchid': (0xba/0xff, 0x55/0xff, 0xd3/0xff),
558     'medium purple': (0x93/0xff, 0x70/0xff, 0xdb/0xff),
559     'medium sea green': (0x3c/0xff, 0xb3/0xff, 0x71/0xff),
560     'medium slate blue': (0x7b/0xff, 0x68/0xff, 0xee/0xff),
561     'medium spring green': (0x00/0xff, 0xfa/0xff, 0x9a/0xff),
562     'medium turquoise': (0x48/0xff, 0xd1/0xff, 0xcc/0xff),
563     'medium violet red': (0xc7/0xff, 0x15/0xff, 0x85/0xff),
564     'mediumaquamarine': (0x66/0xff, 0xcd/0xff, 0xaa/0xff),
565     'mediumblue': (0x00/0xff, 0x00/0xff, 0xcd/0xff),
566     'mediumorchid': (0xba/0xff, 0x55/0xff, 0xd3/0xff),
567     'mediumorchid1': (0xe0/0xff, 0x66/0xff, 0xff/0xff),
568     'mediumorchid2': (0xd1/0xff, 0x5f/0xff, 0xee/0xff),
569     'mediumorchid3': (0xb4/0xff, 0x52/0xff, 0xcd/0xff),
570     'mediumorchid4': (0x7a/0xff, 0x37/0xff, 0x8b/0xff),
571     'mediumpurple': (0x93/0xff, 0x70/0xff, 0xdb/0xff),
572     'mediumpurple1': (0xab/0xff, 0x82/0xff, 0xff/0xff),
573     'mediumpurple2': (0x9f/0xff, 0x79/0xff, 0xee/0xff),
574     'mediumpurple3': (0x89/0xff, 0x68/0xff, 0xcd/0xff),
575     'mediumpurple4': (0x5d/0xff, 0x47/0xff, 0x8b/0xff),
576     'mediumseagreen': (0x3c/0xff, 0xb3/0xff, 0x71/0xff),
577     'mediumslateblue': (0x7b/0xff, 0x68/0xff, 0xee/0xff),
578     'mediumspringgreen': (0x00/0xff, 0xfa/0xff, 0x9a/0xff),
579     'mediumturquoise': (0x48/0xff, 0xd1/0xff, 0xcc/0xff),
580     'mediumvioletred': (0xc7/0xff, 0x15/0xff, 0x85/0xff),
581     'midnight blue': (0x19/0xff, 0x19/0xff, 0x70/0xff),
582     'midnightblue': (0x19/0xff, 0x19/0xff, 0x70/0xff),
583     'mint cream': (0xf5/0xff, 0xff/0xff, 0xfa/0xff),
584     'mintcream': (0xf5/0xff, 0xff/0xff, 0xfa/0xff),
585     'misty rose': (0xff/0xff, 0xe4/0xff, 0xe1/0xff),
586     'mistyrose': (0xff/0xff, 0xe4/0xff, 0xe1/0xff),
587     'mistyrose1': (0xff/0xff, 0xe4/0xff, 0xe1/0xff),
588     'mistyrose2': (0xee/0xff, 0xd5/0xff, 0xd2/0xff),
589     'mistyrose3': (0xcd/0xff, 0xb7/0xff, 0xb5/0xff),
590     'mistyrose4': (0x8b/0xff, 0x7d/0xff, 0x7b/0xff),
591     'moccasin': (0xff/0xff, 0xe4/0xff, 0xb5/0xff),
592     'navajo white': (0xff/0xff, 0xde/0xff, 0xad/0xff),
593     'navajowhite': (0xff/0xff, 0xde/0xff, 0xad/0xff),
594     'navajowhite1': (0xff/0xff, 0xde/0xff, 0xad/0xff),
595     'navajowhite2': (0xee/0xff, 0xcf/0xff, 0xa1/0xff),
596     'navajowhite3': (0xcd/0xff, 0xb3/0xff, 0x8b/0xff),
597     'navajowhite4': (0x8b/0xff, 0x79/0xff, 0x5e/0xff),
598     'navy': (0x00/0xff, 0x00/0xff, 0x80/0xff),
599     'navy blue': (0x00/0xff, 0x00/0xff, 0x80/0xff),
600     'navyblue': (0x00/0xff, 0x00/0xff, 0x80/0xff),
601     'old lace': (0xfd/0xff, 0xf5/0xff, 0xe6/0xff),
602     'oldlace': (0xfd/0xff, 0xf5/0xff, 0xe6/0xff),
603     'olive drab': (0x6b/0xff, 0x8e/0xff, 0x23/0xff),
604     'olivedrab': (0x6b/0xff, 0x8e/0xff, 0x23/0xff),
605     'olivedrab1': (0xc0/0xff, 0xff/0xff, 0x3e/0xff),
606     'olivedrab2': (0xb3/0xff, 0xee/0xff, 0x3a/0xff),
607     'olivedrab3': (0x9a/0xff, 0xcd/0xff, 0x32/0xff),
608     'olivedrab4': (0x69/0xff, 0x8b/0xff, 0x22/0xff),
609     'orange': (0xff/0xff, 0xa5/0xff, 0x00/0xff),
610     'orange red': (0xff/0xff, 0x45/0xff, 0x00/0xff),
611     'orange1': (0xff/0xff, 0xa5/0xff, 0x00/0xff),
612     'orange2': (0xee/0xff, 0x9a/0xff, 0x00/0xff),
613     'orange3': (0xcd/0xff, 0x85/0xff, 0x00/0xff),
614     'orange4': (0x8b/0xff, 0x5a/0xff, 0x00/0xff),
615     'orangered': (0xff/0xff, 0x45/0xff, 0x00/0xff),
616     'orangered1': (0xff/0xff, 0x45/0xff, 0x00/0xff),
617     'orangered2': (0xee/0xff, 0x40/0xff, 0x00/0xff),
618     'orangered3': (0xcd/0xff, 0x37/0xff, 0x00/0xff),
619     'orangered4': (0x8b/0xff, 0x25/0xff, 0x00/0xff),
620     'orchid': (0xda/0xff, 0x70/0xff, 0xd6/0xff),
621     'orchid1': (0xff/0xff, 0x83/0xff, 0xfa/0xff),
622     'orchid2': (0xee/0xff, 0x7a/0xff, 0xe9/0xff),
623     'orchid3': (0xcd/0xff, 0x69/0xff, 0xc9/0xff),
624     'orchid4': (0x8b/0xff, 0x47/0xff, 0x89/0xff),
625     'pale goldenrod': (0xee/0xff, 0xe8/0xff, 0xaa/0xff),
626     'pale green': (0x98/0xff, 0xfb/0xff, 0x98/0xff),
627     'pale turquoise': (0xaf/0xff, 0xee/0xff, 0xee/0xff),
628     'pale violet red': (0xdb/0xff, 0x70/0xff, 0x93/0xff),
629     'palegoldenrod': (0xee/0xff, 0xe8/0xff, 0xaa/0xff),
630     'palegreen': (0x98/0xff, 0xfb/0xff, 0x98/0xff),
631     'palegreen1': (0x9a/0xff, 0xff/0xff, 0x9a/0xff),
632     'palegreen2': (0x90/0xff, 0xee/0xff, 0x90/0xff),
633     'palegreen3': (0x7c/0xff, 0xcd/0xff, 0x7c/0xff),
634     'palegreen4': (0x54/0xff, 0x8b/0xff, 0x54/0xff),
635     'paleturquoise': (0xaf/0xff, 0xee/0xff, 0xee/0xff),
636     'paleturquoise1': (0xbb/0xff, 0xff/0xff, 0xff/0xff),
637     'paleturquoise2': (0xae/0xff, 0xee/0xff, 0xee/0xff),
638     'paleturquoise3': (0x96/0xff, 0xcd/0xff, 0xcd/0xff),
639     'paleturquoise4': (0x66/0xff, 0x8b/0xff, 0x8b/0xff),
640     'palevioletred': (0xdb/0xff, 0x70/0xff, 0x93/0xff),
641     'palevioletred1': (0xff/0xff, 0x82/0xff, 0xab/0xff),
642     'palevioletred2': (0xee/0xff, 0x79/0xff, 0x9f/0xff),
643     'palevioletred3': (0xcd/0xff, 0x68/0xff, 0x7f/0xff),
644     'palevioletred4': (0x8b/0xff, 0x47/0xff, 0x5d/0xff),
645     'papaya whip': (0xff/0xff, 0xef/0xff, 0xd5/0xff),
646     'papayawhip': (0xff/0xff, 0xef/0xff, 0xd5/0xff),
647     'peach puff': (0xff/0xff, 0xda/0xff, 0xb9/0xff),
648     'peachpuff': (0xff/0xff, 0xda/0xff, 0xb9/0xff),
649     'peachpuff1': (0xff/0xff, 0xda/0xff, 0xb9/0xff),
650     'peachpuff2': (0xee/0xff, 0xcb/0xff, 0xad/0xff),
651     'peachpuff3': (0xcd/0xff, 0xaf/0xff, 0x95/0xff),
652     'peachpuff4': (0x8b/0xff, 0x77/0xff, 0x65/0xff),
653     'peru': (0xcd/0xff, 0x85/0xff, 0x3f/0xff),
654     'pink': (0xff/0xff, 0xc0/0xff, 0xcb/0xff),
655     'pink1': (0xff/0xff, 0xb5/0xff, 0xc5/0xff),
656     'pink2': (0xee/0xff, 0xa9/0xff, 0xb8/0xff),
657     'pink3': (0xcd/0xff, 0x91/0xff, 0x9e/0xff),
658     'pink4': (0x8b/0xff, 0x63/0xff, 0x6c/0xff),
659     'plum': (0xdd/0xff, 0xa0/0xff, 0xdd/0xff),
660     'plum1': (0xff/0xff, 0xbb/0xff, 0xff/0xff),
661     'plum2': (0xee/0xff, 0xae/0xff, 0xee/0xff),
662     'plum3': (0xcd/0xff, 0x96/0xff, 0xcd/0xff),
663     'plum4': (0x8b/0xff, 0x66/0xff, 0x8b/0xff),
664     'powder blue': (0xb0/0xff, 0xe0/0xff, 0xe6/0xff),
665     'powderblue': (0xb0/0xff, 0xe0/0xff, 0xe6/0xff),
666     'purple': (0x80/0xff, 0x00/0xff, 0x80/0xff),
667     'purple1': (0x9b/0xff, 0x30/0xff, 0xff/0xff),
668     'purple2': (0x91/0xff, 0x2c/0xff, 0xee/0xff),
669     'purple3': (0x7d/0xff, 0x26/0xff, 0xcd/0xff),
670     'purple4': (0x55/0xff, 0x1a/0xff, 0x8b/0xff),
671     'red': (0xff/0xff, 0x00/0xff, 0x00/0xff),
672     'red1': (0xff/0xff, 0x00/0xff, 0x00/0xff),
673     'red2': (0xee/0xff, 0x00/0xff, 0x00/0xff),
674     'red3': (0xcd/0xff, 0x00/0xff, 0x00/0xff),
675     'red4': (0x8b/0xff, 0x00/0xff, 0x00/0xff),
676     'rosy brown': (0xbc/0xff, 0x8f/0xff, 0x8f/0xff),
677     'rosybrown': (0xbc/0xff, 0x8f/0xff, 0x8f/0xff),
678     'rosybrown1': (0xff/0xff, 0xc1/0xff, 0xc1/0xff),
679     'rosybrown2': (0xee/0xff, 0xb4/0xff, 0xb4/0xff),
680     'rosybrown3': (0xcd/0xff, 0x9b/0xff, 0x9b/0xff),
681     'rosybrown4': (0x8b/0xff, 0x69/0xff, 0x69/0xff),
682     'royal blue': (0x41/0xff, 0x69/0xff, 0xe1/0xff),
683     'royalblue': (0x41/0xff, 0x69/0xff, 0xe1/0xff),
684     'royalblue1': (0x48/0xff, 0x76/0xff, 0xff/0xff),
685     'royalblue2': (0x43/0xff, 0x6e/0xff, 0xee/0xff),
686     'royalblue3': (0x3a/0xff, 0x5f/0xff, 0xcd/0xff),
687     'royalblue4': (0x27/0xff, 0x40/0xff, 0x8b/0xff),
688     'saddle brown': (0x8b/0xff, 0x45/0xff, 0x13/0xff),
689     'saddlebrown': (0x8b/0xff, 0x45/0xff, 0x13/0xff),
690     'salmon': (0xfa/0xff, 0x80/0xff, 0x72/0xff),
691     'salmon1': (0xff/0xff, 0x8c/0xff, 0x69/0xff),
692     'salmon2': (0xee/0xff, 0x82/0xff, 0x62/0xff),
693     'salmon3': (0xcd/0xff, 0x70/0xff, 0x54/0xff),
694     'salmon4': (0x8b/0xff, 0x4c/0xff, 0x39/0xff),
695     'sandy brown': (0xf4/0xff, 0xa4/0xff, 0x60/0xff),
696     'sandybrown': (0xf4/0xff, 0xa4/0xff, 0x60/0xff),
697     'sea green': (0x2e/0xff, 0x8b/0xff, 0x57/0xff),
698     'seagreen': (0x2e/0xff, 0x8b/0xff, 0x57/0xff),
699     'seagreen1': (0x54/0xff, 0xff/0xff, 0x9f/0xff),
700     'seagreen2': (0x4e/0xff, 0xee/0xff, 0x94/0xff),
701     'seagreen3': (0x43/0xff, 0xcd/0xff, 0x80/0xff),
702     'seagreen4': (0x2e/0xff, 0x8b/0xff, 0x57/0xff),
703     'seashell': (0xff/0xff, 0xf5/0xff, 0xee/0xff),
704     'seashell1': (0xff/0xff, 0xf5/0xff, 0xee/0xff),
705     'seashell2': (0xee/0xff, 0xe5/0xff, 0xde/0xff),
706     'seashell3': (0xcd/0xff, 0xc5/0xff, 0xbf/0xff),
707     'seashell4': (0x8b/0xff, 0x86/0xff, 0x82/0xff),
708     'sienna': (0xa0/0xff, 0x52/0xff, 0x2d/0xff),
709     'sienna1': (0xff/0xff, 0x82/0xff, 0x47/0xff),
710     'sienna2': (0xee/0xff, 0x79/0xff, 0x42/0xff),
711     'sienna3': (0xcd/0xff, 0x68/0xff, 0x39/0xff),
712     'sienna4': (0x8b/0xff, 0x47/0xff, 0x26/0xff),
713     'sky blue': (0x87/0xff, 0xce/0xff, 0xeb/0xff),
714     'skyblue': (0x87/0xff, 0xce/0xff, 0xeb/0xff),
715     'skyblue1': (0x87/0xff, 0xce/0xff, 0xff/0xff),
716     'skyblue2': (0x7e/0xff, 0xc0/0xff, 0xee/0xff),
717     'skyblue3': (0x6c/0xff, 0xa6/0xff, 0xcd/0xff),
718     'skyblue4': (0x4a/0xff, 0x70/0xff, 0x8b/0xff),
719     'slate blue': (0x6a/0xff, 0x5a/0xff, 0xcd/0xff),
720     'slate gray': (0x70/0xff, 0x80/0xff, 0x90/0xff),
721     'slate grey': (0x70/0xff, 0x80/0xff, 0x90/0xff),
722     'slateblue': (0x6a/0xff, 0x5a/0xff, 0xcd/0xff),
723     'slateblue1': (0x83/0xff, 0x6f/0xff, 0xff/0xff),
724     'slateblue2': (0x7a/0xff, 0x67/0xff, 0xee/0xff),
725     'slateblue3': (0x69/0xff, 0x59/0xff, 0xcd/0xff),
726     'slateblue4': (0x47/0xff, 0x3c/0xff, 0x8b/0xff),
727     'slategray': (0x70/0xff, 0x80/0xff, 0x90/0xff),
728     'slategray1': (0xc6/0xff, 0xe2/0xff, 0xff/0xff),
729     'slategray2': (0xb9/0xff, 0xd3/0xff, 0xee/0xff),
730     'slategray3': (0x9f/0xff, 0xb6/0xff, 0xcd/0xff),
731     'slategray4': (0x6c/0xff, 0x7b/0xff, 0x8b/0xff),
732     'slategrey': (0x70/0xff, 0x80/0xff, 0x90/0xff),
733     'snow': (0xff/0xff, 0xfa/0xff, 0xfa/0xff),
734     'snow1': (0xff/0xff, 0xfa/0xff, 0xfa/0xff),
735     'snow2': (0xee/0xff, 0xe9/0xff, 0xe9/0xff),
736     'snow3': (0xcd/0xff, 0xc9/0xff, 0xc9/0xff),
737     'snow4': (0x8b/0xff, 0x89/0xff, 0x89/0xff),
738     'spring green': (0x00/0xff, 0xff/0xff, 0x7f/0xff),
739     'springgreen': (0x00/0xff, 0xff/0xff, 0x7f/0xff),
740     'springgreen1': (0x00/0xff, 0xff/0xff, 0x7f/0xff),
741     'springgreen2': (0x00/0xff, 0xee/0xff, 0x76/0xff),
742     'springgreen3': (0x00/0xff, 0xcd/0xff, 0x66/0xff),
743     'springgreen4': (0x00/0xff, 0x8b/0xff, 0x45/0xff),
744     'steel blue': (0x46/0xff, 0x82/0xff, 0xb4/0xff),
745     'steelblue': (0x46/0xff, 0x82/0xff, 0xb4/0xff),
746     'steelblue1': (0x63/0xff, 0xb8/0xff, 0xff/0xff),
747     'steelblue2': (0x5c/0xff, 0xac/0xff, 0xee/0xff),
748     'steelblue3': (0x4f/0xff, 0x94/0xff, 0xcd/0xff),
749     'steelblue4': (0x36/0xff, 0x64/0xff, 0x8b/0xff),
750     'tan': (0xd2/0xff, 0xb4/0xff, 0x8c/0xff),
751     'tan1': (0xff/0xff, 0xa5/0xff, 0x4f/0xff),
752     'tan2': (0xee/0xff, 0x9a/0xff, 0x49/0xff),
753     'tan3': (0xcd/0xff, 0x85/0xff, 0x3f/0xff),
754     'tan4': (0x8b/0xff, 0x5a/0xff, 0x2b/0xff),
755     'thistle': (0xd8/0xff, 0xbf/0xff, 0xd8/0xff),
756     'thistle1': (0xff/0xff, 0xe1/0xff, 0xff/0xff),
757     'thistle2': (0xee/0xff, 0xd2/0xff, 0xee/0xff),
758     'thistle3': (0xcd/0xff, 0xb5/0xff, 0xcd/0xff),
759     'thistle4': (0x8b/0xff, 0x7b/0xff, 0x8b/0xff),
760     'tomato': (0xff/0xff, 0x63/0xff, 0x47/0xff),
761     'tomato1': (0xff/0xff, 0x63/0xff, 0x47/0xff),
762     'tomato2': (0xee/0xff, 0x5c/0xff, 0x42/0xff),
763     'tomato3': (0xcd/0xff, 0x4f/0xff, 0x39/0xff),
764     'tomato4': (0x8b/0xff, 0x36/0xff, 0x26/0xff),
765     'turquoise': (0x40/0xff, 0xe0/0xff, 0xd0/0xff),
766     'turquoise1': (0x00/0xff, 0xf5/0xff, 0xff/0xff),
767     'turquoise2': (0x00/0xff, 0xe5/0xff, 0xee/0xff),
768     'turquoise3': (0x00/0xff, 0xc5/0xff, 0xcd/0xff),
769     'turquoise4': (0x00/0xff, 0x86/0xff, 0x8b/0xff),
770     'violet': (0xee/0xff, 0x82/0xff, 0xee/0xff),
771     'violet red': (0xd0/0xff, 0x20/0xff, 0x90/0xff),
772     'violetred': (0xd0/0xff, 0x20/0xff, 0x90/0xff),
773     'violetred1': (0xff/0xff, 0x3e/0xff, 0x96/0xff),
774     'violetred2': (0xee/0xff, 0x3a/0xff, 0x8c/0xff),
775     'violetred3': (0xcd/0xff, 0x32/0xff, 0x78/0xff),
776     'violetred4': (0x8b/0xff, 0x22/0xff, 0x52/0xff),
777     'wheat': (0xf5/0xff, 0xde/0xff, 0xb3/0xff),
778     'wheat1': (0xff/0xff, 0xe7/0xff, 0xba/0xff),
779     'wheat2': (0xee/0xff, 0xd8/0xff, 0xae/0xff),
780     'wheat3': (0xcd/0xff, 0xba/0xff, 0x96/0xff),
781     'wheat4': (0x8b/0xff, 0x7e/0xff, 0x66/0xff),
782     'white': (0xff/0xff, 0xff/0xff, 0xff/0xff),
783     'white smoke': (0xf5/0xff, 0xf5/0xff, 0xf5/0xff),
784     'whitesmoke': (0xf5/0xff, 0xf5/0xff, 0xf5/0xff),
785     'yellow': (0xff/0xff, 0xff/0xff, 0x00/0xff),
786     'yellow green': (0x9a/0xff, 0xcd/0xff, 0x32/0xff),
787     'yellow1': (0xff/0xff, 0xff/0xff, 0x00/0xff),
788     'yellow2': (0xee/0xff, 0xee/0xff, 0x00/0xff),
789     'yellow3': (0xcd/0xff, 0xcd/0xff, 0x00/0xff),
790     'yellow4': (0x8b/0xff, 0x8b/0xff, 0x00/0xff),
791     'yellowgreen': (0x9a/0xff, 0xcd/0xff, 0x32/0xff)
792 };
793
794 with cairo.SVGSurface(filename, 512, 512) as surface:
795     cr = cairo.Context(surface);
796     del cairo
797
798     def arc(x, y, r, a1, a2):
799         cr.arc(x, y, r, a1, a2);
800
801     def circle(x, y, r):
802         cr.arc(x, y, r, 0, 2 * math.pi);
803
804     def fill():
805         cr.fill();
806
807     def set_color(color):
808         if color in COLORS:
809             (r,g,b) = COLORS[color];
810         else:
811             (r,g,b) = (0,0,0)
812         cr.set_source_rgb(r, g, b)
813
814     cr.set_line_width(6);
815     exec(input)
816
817 web_file = filename.removeprefix(OUTPUT_DIR_PREFIX);
818
819 print(web_file);
820
821