1    // Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
2    package org.xwt;
3    import java.util.*;
4    
5    public class SVG {
6    
7        /** Copied verbatim from the SVG specification */
8        public static Hashtable colors = new Hashtable(400);
9        static {
10   	colors.put("aliceblue", new Integer((240 << 16) | (248 << 8) | 255));
11   	colors.put("antiquewhite", new Integer((250 << 16) | (235 << 8) | 215));
12   	colors.put("aqua", new Integer((0 << 16) | (255 << 8) | 255));
13   	colors.put("aquamarine", new Integer((127 << 16) | (255 << 8) | 212));
14   	colors.put("azure", new Integer((240 << 16) | (255 << 8) | 255));
15   	colors.put("beige", new Integer((245 << 16) | (245 << 8) | 220));
16   	colors.put("bisque", new Integer((255 << 16) | (228 << 8) | 196));
17   	colors.put("black", new Integer((0 << 16) | (0 << 8) | 0));
18   	colors.put("blanchedalmond", new Integer((255 << 16) | (235 << 8) | 205));
19   	colors.put("blue", new Integer((0 << 16) | (0 << 8) | 255));
20   	colors.put("blueviolet", new Integer((138 << 16) | (43 << 8) | 226));
21   	colors.put("brown", new Integer((165 << 16) | (42 << 8) | 42));
22   	colors.put("burlywood", new Integer((222 << 16) | (184 << 8) | 135));
23   	colors.put("cadetblue", new Integer((95 << 16) | (158 << 8) | 160));
24   	colors.put("chartreuse", new Integer((127 << 16) | (255 << 8) | 0));
25   	colors.put("chocolate", new Integer((210 << 16) | (105 << 8) | 30));
26   	colors.put("coral", new Integer((255 << 16) | (127 << 8) | 80));
27   	colors.put("cornflowerblue", new Integer((100 << 16) | (149 << 8) | 237));
28   	colors.put("cornsilk", new Integer((255 << 16) | (248 << 8) | 220));
29   	colors.put("crimson", new Integer((220 << 16) | (20 << 8) | 60));
30   	colors.put("cyan", new Integer((0 << 16) | (255 << 8) | 255));
31   	colors.put("darkblue", new Integer((0 << 16) | (0 << 8) | 139));
32   	colors.put("darkcyan", new Integer((0 << 16) | (139 << 8) | 139));
33   	colors.put("darkgoldenrod", new Integer((184 << 16) | (134 << 8) | 11));
34   	colors.put("darkgray", new Integer((169 << 16) | (169 << 8) | 169));
35   	colors.put("darkgreen", new Integer((0 << 16) | (100 << 8) | 0));
36   	colors.put("darkgrey", new Integer((169 << 16) | (169 << 8) | 169));
37   	colors.put("darkkhaki", new Integer((189 << 16) | (183 << 8) | 107));
38   	colors.put("darkmagenta", new Integer((139 << 16) | (0 << 8) | 139));
39   	colors.put("darkolivegreen", new Integer((85 << 16) | (107 << 8) | 47));
40   	colors.put("darkorange", new Integer((255 << 16) | (140 << 8) | 0));
41   	colors.put("darkorchid", new Integer((153 << 16) | (50 << 8) | 204));
42   	colors.put("darkred", new Integer((139 << 16) | (0 << 8) | 0));
43   	colors.put("darksalmon", new Integer((233 << 16) | (150 << 8) | 122));
44   	colors.put("darkseagreen", new Integer((143 << 16) | (188 << 8) | 143));
45   	colors.put("darkslateblue", new Integer((72 << 16) | (61 << 8) | 139));
46   	colors.put("darkslategray", new Integer((47 << 16) | (79 << 8) | 79));
47   	colors.put("darkslategrey", new Integer((47 << 16) | (79 << 8) | 79));
48   	colors.put("darkturquoise", new Integer((0 << 16) | (206 << 8) | 209));
49   	colors.put("darkviolet", new Integer((148 << 16) | (0 << 8) | 211));
50   	colors.put("deeppink", new Integer((255 << 16) | (20 << 8) | 147));
51   	colors.put("deepskyblue", new Integer((0 << 16) | (191 << 8) | 255));
52   	colors.put("dimgray", new Integer((105 << 16) | (105 << 8) | 105));
53   	colors.put("dimgrey", new Integer((105 << 16) | (105 << 8) | 105));
54   	colors.put("dodgerblue", new Integer((30 << 16) | (144 << 8) | 255));
55   	colors.put("firebrick", new Integer((178 << 16) | (34 << 8) | 34));
56   	colors.put("floralwhite", new Integer((255 << 16) | (250 << 8) | 240));
57   	colors.put("forestgreen", new Integer((34 << 16) | (139 << 8) | 34));
58   	colors.put("fuchsia", new Integer((255 << 16) | (0 << 8) | 255));
59   	colors.put("gainsboro", new Integer((220 << 16) | (220 << 8) | 220));
60   	colors.put("ghostwhite", new Integer((248 << 16) | (248 << 8) | 255));
61   	colors.put("gold", new Integer((255 << 16) | (215 << 8) | 0));
62   	colors.put("goldenrod", new Integer((218 << 16) | (165 << 8) | 32));
63   	colors.put("gray", new Integer((128 << 16) | (128 << 8) | 128));
64   	colors.put("grey", new Integer((128 << 16) | (128 << 8) | 128));
65   	colors.put("green", new Integer((0 << 16) | (128 << 8) | 0));
66   	colors.put("greenyellow", new Integer((173 << 16) | (255 << 8) | 47));
67   	colors.put("honeydew", new Integer((240 << 16) | (255 << 8) | 240));
68   	colors.put("hotpink", new Integer((255 << 16) | (105 << 8) | 180));
69   	colors.put("indianred", new Integer((205 << 16) | (92 << 8) | 92));
70   	colors.put("indigo", new Integer((75 << 16) | (0 << 8) | 130));
71   	colors.put("ivory", new Integer((255 << 16) | (255 << 8) | 240));
72   	colors.put("khaki", new Integer((240 << 16) | (230 << 8) | 140));
73   	colors.put("lavender", new Integer((230 << 16) | (230 << 8) | 250));
74   	colors.put("lavenderblush", new Integer((255 << 16) | (240 << 8) | 245));
75   	colors.put("lawngreen", new Integer((124 << 16) | (252 << 8) | 0));
76   	colors.put("lemonchiffon", new Integer((255 << 16) | (250 << 8) | 205));
77   	colors.put("lightblue", new Integer((173 << 16) | (216 << 8) | 230));
78   	colors.put("lightcoral", new Integer((240 << 16) | (128 << 8) | 128));
79   	colors.put("lightcyan", new Integer((224 << 16) | (255 << 8) | 255));
80   	colors.put("lightgoldenrodyellow", new Integer((250 << 16) | (250 << 8) | 210));
81   	colors.put("lightgray", new Integer((211 << 16) | (211 << 8) | 211));
82   	colors.put("lightgreen", new Integer((144 << 16) | (238 << 8) | 144));
83   	colors.put("lightgrey", new Integer((211 << 16) | (211 << 8) | 211));
84   	colors.put("lightpink", new Integer((255 << 16) | (182 << 8) | 193));
85   	colors.put("lightsalmon", new Integer((255 << 16) | (160 << 8) | 122));
86   	colors.put("lightseagreen", new Integer((32 << 16) | (178 << 8) | 170));
87   	colors.put("lightskyblue", new Integer((135 << 16) | (206 << 8) | 250));
88   	colors.put("lightslategray", new Integer((119 << 16) | (136 << 8) | 153));
89   	colors.put("lightslategrey", new Integer((119 << 16) | (136 << 8) | 153));
90   	colors.put("lightsteelblue", new Integer((176 << 16) | (196 << 8) | 222));
91   	colors.put("lightyellow", new Integer((255 << 16) | (255 << 8) | 224));
92   	colors.put("lime", new Integer((0 << 16) | (255 << 8) | 0));
93   	colors.put("limegreen", new Integer((50 << 16) | (205 << 8) | 50));
94   	colors.put("linen", new Integer((250 << 16) | (240 << 8) | 230));
95   	colors.put("magenta", new Integer((255 << 16) | (0 << 8) | 255));
96   	colors.put("maroon", new Integer((128 << 16) | (0 << 8) | 0));
97   	colors.put("mediumaquamarine", new Integer((102 << 16) | (205 << 8) | 170));
98   	colors.put("mediumblue", new Integer((0 << 16) | (0 << 8) | 205));
99   	colors.put("mediumorchid", new Integer((186 << 16) | (85 << 8) | 211));
100  	colors.put("mediumpurple", new Integer((147 << 16) | (112 << 8) | 219));
101  	colors.put("mediumseagreen", new Integer((60 << 16) | (179 << 8) | 113));
102  	colors.put("mediumslateblue", new Integer((123 << 16) | (104 << 8) | 238));
103  	colors.put("mediumspringgreen", new Integer((0 << 16) | (250 << 8) | 154));
104  	colors.put("mediumturquoise", new Integer((72 << 16) | (209 << 8) | 204));
105  	colors.put("mediumvioletred", new Integer((199 << 16) | (21 << 8) | 133));
106  	colors.put("midnightblue", new Integer((25 << 16) | (25 << 8) | 112));
107  	colors.put("mintcream", new Integer((245 << 16) | (255 << 8) | 250));
108  	colors.put("mistyrose", new Integer((255 << 16) | (228 << 8) | 225));
109  	colors.put("moccasin", new Integer((255 << 16) | (228 << 8) | 181));
110  	colors.put("navajowhite", new Integer((255 << 16) | (222 << 8) | 173));
111  	colors.put("navy", new Integer((0 << 16) | (0 << 8) | 128));
112  	colors.put("oldlace", new Integer((253 << 16) | (245 << 8) | 230));
113  	colors.put("olive", new Integer((128 << 16) | (128 << 8) | 0));
114  	colors.put("olivedrab", new Integer((107 << 16) | (142 << 8) | 35));
115  	colors.put("orange", new Integer((255 << 16) | (165 << 8) | 0));
116  	colors.put("orangered", new Integer((255 << 16) | (69 << 8) | 0));
117  	colors.put("orchid", new Integer((218 << 16) | (112 << 8) | 214));
118  	colors.put("palegoldenrod", new Integer((238 << 16) | (232 << 8) | 170));
119  	colors.put("palegreen", new Integer((152 << 16) | (251 << 8) | 152));
120  	colors.put("paleturquoise", new Integer((175 << 16) | (238 << 8) | 238));
121  	colors.put("palevioletred", new Integer((219 << 16) | (112 << 8) | 147));
122  	colors.put("papayawhip", new Integer((255 << 16) | (239 << 8) | 213));
123  	colors.put("peachpuff", new Integer((255 << 16) | (218 << 8) | 185));
124  	colors.put("peru", new Integer((205 << 16) | (133 << 8) | 63));
125  	colors.put("pink", new Integer((255 << 16) | (192 << 8) | 203));
126  	colors.put("plum", new Integer((221 << 16) | (160 << 8) | 221));
127  	colors.put("powderblue", new Integer((176 << 16) | (224 << 8) | 230));
128  	colors.put("purple", new Integer((128 << 16) | (0 << 8) | 128));
129  	colors.put("red", new Integer((255 << 16) | (0 << 8) | 0));
130  	colors.put("rosybrown", new Integer((188 << 16) | (143 << 8) | 143));
131  	colors.put("royalblue", new Integer((65 << 16) | (105 << 8) | 225));
132  	colors.put("saddlebrown", new Integer((139 << 16) | (69 << 8) | 19));
133  	colors.put("salmon", new Integer((250 << 16) | (128 << 8) | 114));
134  	colors.put("sandybrown", new Integer((244 << 16) | (164 << 8) | 96));
135  	colors.put("seagreen", new Integer((46 << 16) | (139 << 8) | 87));
136  	colors.put("seashell", new Integer((255 << 16) | (245 << 8) | 238));
137  	colors.put("sienna", new Integer((160 << 16) | (82 << 8) | 45));
138  	colors.put("silver", new Integer((192 << 16) | (192 << 8) | 192));
139  	colors.put("skyblue", new Integer((135 << 16) | (206 << 8) | 235));
140  	colors.put("slateblue", new Integer((106 << 16) | (90 << 8) | 205));
141  	colors.put("slategray", new Integer((112 << 16) | (128 << 8) | 144));
142  	colors.put("slategrey", new Integer((112 << 16) | (128 << 8) | 144));
143  	colors.put("snow", new Integer((255 << 16) | (250 << 8) | 250));
144  	colors.put("springgreen", new Integer((0 << 16) | (255 << 8) | 127));
145  	colors.put("steelblue", new Integer((70 << 16) | (130 << 8) | 180));
146  	colors.put("tan", new Integer((210 << 16) | (180 << 8) | 140));
147  	colors.put("teal", new Integer((0 << 16) | (128 << 8) | 128));
148  	colors.put("thistle", new Integer((216 << 16) | (191 << 8) | 216));
149  	colors.put("tomato", new Integer((255 << 16) | (99 << 8) | 71));
150  	colors.put("turquoise", new Integer((64 << 16) | (224 << 8) | 208));
151  	colors.put("violet", new Integer((238 << 16) | (130 << 8) | 238));
152  	colors.put("wheat", new Integer((245 << 16) | (222 << 8) | 179));
153  	colors.put("white", new Integer((255 << 16) | (255 << 8) | 255));
154  	colors.put("whitesmoke", new Integer((245 << 16) | (245 << 8) | 245));
155  	colors.put("yellow", new Integer((255 << 16) | (255 << 8) | 0));
156  	colors.put("yellowgreen", new Integer((154 << 16) | (205 << 8) | 50));
157      }
158  
159  }
160