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