1 package Imager::Color::Table;
12 next if /^#/ or !/\S/;
14 my ($r, $g, $b, $name) = split ' ', $_, 4;
16 $colors{lc $name} = [ $r, $g, $b ];
22 my ($class, $name) = @_;
24 exists $colors{lc $name} or return;
26 return @{$colors{lc $name}};
32 # This color data was extracted from the freedesktop.org CVS tree, and
33 # appears to be under the following license:
35 # Copyright (C) 2004 X Consortium
37 # Permission is hereby granted, free of charge, to any person obtaining a copy
38 # of this software and associated documentation files (the "Software"), to
39 # deal in the Software without restriction, including without limitation the
40 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
41 # sell copies of the Software, and to permit persons to whom the Software is
42 # furnished to do so, subject to the following conditions:
44 # The above copyright notice and this permission notice shall be included in
45 # all copies or substantial portions of the Software.
47 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
51 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
52 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
54 # Except as contained in this notice, the name of the X Consortium shall not
55 # be used in advertising or otherwise to promote the sale, use or other deal-
56 # ings in this Software without prior written authorization from the X Consor-
59 # X Window System is a trademark of X Consortium, Inc.
62 248 248 255 ghost white
63 248 248 255 GhostWhite
64 245 245 245 white smoke
65 245 245 245 WhiteSmoke
67 255 250 240 floral white
68 255 250 240 FloralWhite
72 250 235 215 antique white
73 250 235 215 AntiqueWhite
74 255 239 213 papaya whip
75 255 239 213 PapayaWhip
76 255 235 205 blanched almond
77 255 235 205 BlanchedAlmond
79 255 218 185 peach puff
81 255 222 173 navajo white
82 255 222 173 NavajoWhite
86 255 250 205 lemon chiffon
87 255 250 205 LemonChiffon
90 245 255 250 mint cream
93 240 248 255 alice blue
96 255 240 245 lavender blush
97 255 240 245 LavenderBlush
98 255 228 225 misty rose
102 47 79 79 dark slate gray
103 47 79 79 DarkSlateGray
104 47 79 79 dark slate grey
105 47 79 79 DarkSlateGrey
110 112 128 144 slate gray
111 112 128 144 SlateGray
112 112 128 144 slate grey
113 112 128 144 SlateGrey
114 119 136 153 light slate gray
115 119 136 153 LightSlateGray
116 119 136 153 light slate grey
117 119 136 153 LightSlateGrey
120 211 211 211 light grey
121 211 211 211 LightGrey
122 211 211 211 light gray
123 211 211 211 LightGray
124 25 25 112 midnight blue
125 25 25 112 MidnightBlue
129 100 149 237 cornflower blue
130 100 149 237 CornflowerBlue
131 72 61 139 dark slate blue
132 72 61 139 DarkSlateBlue
133 106 90 205 slate blue
135 123 104 238 medium slate blue
136 123 104 238 MediumSlateBlue
137 132 112 255 light slate blue
138 132 112 255 LightSlateBlue
141 65 105 225 royal blue
144 30 144 255 dodger blue
145 30 144 255 DodgerBlue
146 0 191 255 deep sky blue
147 0 191 255 DeepSkyBlue
150 135 206 250 light sky blue
151 135 206 250 LightSkyBlue
152 70 130 180 steel blue
154 176 196 222 light steel blue
155 176 196 222 LightSteelBlue
156 173 216 230 light blue
157 173 216 230 LightBlue
158 176 224 230 powder blue
159 176 224 230 PowderBlue
160 175 238 238 pale turquoise
161 175 238 238 PaleTurquoise
162 0 206 209 dark turquoise
163 0 206 209 DarkTurquoise
164 72 209 204 medium turquoise
165 72 209 204 MediumTurquoise
168 224 255 255 light cyan
169 224 255 255 LightCyan
170 95 158 160 cadet blue
172 102 205 170 medium aquamarine
173 102 205 170 MediumAquamarine
174 127 255 212 aquamarine
177 85 107 47 dark olive green
178 85 107 47 DarkOliveGreen
179 143 188 143 dark sea green
180 143 188 143 DarkSeaGreen
183 60 179 113 medium sea green
184 60 179 113 MediumSeaGreen
185 32 178 170 light sea green
186 32 178 170 LightSeaGreen
187 152 251 152 pale green
188 152 251 152 PaleGreen
189 0 255 127 spring green
190 0 255 127 SpringGreen
195 0 250 154 medium spring green
196 0 250 154 MediumSpringGreen
197 173 255 47 green yellow
198 173 255 47 GreenYellow
201 154 205 50 yellow green
202 154 205 50 YellowGreen
203 34 139 34 forest green
204 34 139 34 ForestGreen
205 107 142 35 olive drab
207 189 183 107 dark khaki
208 189 183 107 DarkKhaki
210 238 232 170 pale goldenrod
211 238 232 170 PaleGoldenrod
212 250 250 210 light goldenrod yellow
213 250 250 210 LightGoldenrodYellow
214 255 255 224 light yellow
215 255 255 224 LightYellow
218 238 221 130 light goldenrod
219 238 221 130 LightGoldenrod
221 184 134 11 dark goldenrod
222 184 134 11 DarkGoldenrod
223 188 143 143 rosy brown
224 188 143 143 RosyBrown
227 139 69 19 saddle brown
228 139 69 19 SaddleBrown
231 222 184 135 burlywood
234 244 164 96 sandy brown
235 244 164 96 SandyBrown
240 233 150 122 dark salmon
241 233 150 122 DarkSalmon
243 255 160 122 light salmon
244 255 160 122 LightSalmon
246 255 140 0 dark orange
249 240 128 128 light coral
250 240 128 128 LightCoral
260 255 182 193 light pink
261 255 182 193 LightPink
262 219 112 147 pale violet red
263 219 112 147 PaleVioletRed
265 199 21 133 medium violet red
266 199 21 133 MediumVioletRed
267 208 32 144 violet red
273 186 85 211 medium orchid
274 186 85 211 MediumOrchid
275 153 50 204 dark orchid
276 153 50 204 DarkOrchid
277 148 0 211 dark violet
279 138 43 226 blue violet
280 138 43 226 BlueViolet
282 147 112 219 medium purple
283 147 112 219 MediumPurple
289 255 245 238 seashell1
290 238 229 222 seashell2
291 205 197 191 seashell3
292 139 134 130 seashell4
293 255 239 219 AntiqueWhite1
294 238 223 204 AntiqueWhite2
295 205 192 176 AntiqueWhite3
296 139 131 120 AntiqueWhite4
301 255 218 185 PeachPuff1
302 238 203 173 PeachPuff2
303 205 175 149 PeachPuff3
304 139 119 101 PeachPuff4
305 255 222 173 NavajoWhite1
306 238 207 161 NavajoWhite2
307 205 179 139 NavajoWhite3
308 139 121 94 NavajoWhite4
309 255 250 205 LemonChiffon1
310 238 233 191 LemonChiffon2
311 205 201 165 LemonChiffon3
312 139 137 112 LemonChiffon4
313 255 248 220 cornsilk1
314 238 232 205 cornsilk2
315 205 200 177 cornsilk3
316 139 136 120 cornsilk4
321 240 255 240 honeydew1
322 224 238 224 honeydew2
323 193 205 193 honeydew3
324 131 139 131 honeydew4
325 255 240 245 LavenderBlush1
326 238 224 229 LavenderBlush2
327 205 193 197 LavenderBlush3
328 139 131 134 LavenderBlush4
329 255 228 225 MistyRose1
330 238 213 210 MistyRose2
331 205 183 181 MistyRose3
332 139 125 123 MistyRose4
337 131 111 255 SlateBlue1
338 122 103 238 SlateBlue2
339 105 89 205 SlateBlue3
341 72 118 255 RoyalBlue1
342 67 110 238 RoyalBlue2
349 30 144 255 DodgerBlue1
350 28 134 238 DodgerBlue2
351 24 116 205 DodgerBlue3
352 16 78 139 DodgerBlue4
353 99 184 255 SteelBlue1
354 92 172 238 SteelBlue2
355 79 148 205 SteelBlue3
356 54 100 139 SteelBlue4
357 0 191 255 DeepSkyBlue1
358 0 178 238 DeepSkyBlue2
359 0 154 205 DeepSkyBlue3
360 0 104 139 DeepSkyBlue4
365 176 226 255 LightSkyBlue1
366 164 211 238 LightSkyBlue2
367 141 182 205 LightSkyBlue3
368 96 123 139 LightSkyBlue4
369 198 226 255 SlateGray1
370 185 211 238 SlateGray2
371 159 182 205 SlateGray3
372 108 123 139 SlateGray4
373 202 225 255 LightSteelBlue1
374 188 210 238 LightSteelBlue2
375 162 181 205 LightSteelBlue3
376 110 123 139 LightSteelBlue4
377 191 239 255 LightBlue1
378 178 223 238 LightBlue2
379 154 192 205 LightBlue3
380 104 131 139 LightBlue4
381 224 255 255 LightCyan1
382 209 238 238 LightCyan2
383 180 205 205 LightCyan3
384 122 139 139 LightCyan4
385 187 255 255 PaleTurquoise1
386 174 238 238 PaleTurquoise2
387 150 205 205 PaleTurquoise3
388 102 139 139 PaleTurquoise4
389 152 245 255 CadetBlue1
390 142 229 238 CadetBlue2
391 122 197 205 CadetBlue3
392 83 134 139 CadetBlue4
401 151 255 255 DarkSlateGray1
402 141 238 238 DarkSlateGray2
403 121 205 205 DarkSlateGray3
404 82 139 139 DarkSlateGray4
405 127 255 212 aquamarine1
406 118 238 198 aquamarine2
407 102 205 170 aquamarine3
408 69 139 116 aquamarine4
409 193 255 193 DarkSeaGreen1
410 180 238 180 DarkSeaGreen2
411 155 205 155 DarkSeaGreen3
412 105 139 105 DarkSeaGreen4
417 154 255 154 PaleGreen1
418 144 238 144 PaleGreen2
419 124 205 124 PaleGreen3
421 0 255 127 SpringGreen1
422 0 238 118 SpringGreen2
423 0 205 102 SpringGreen3
424 0 139 69 SpringGreen4
429 127 255 0 chartreuse1
430 118 238 0 chartreuse2
431 102 205 0 chartreuse3
433 192 255 62 OliveDrab1
434 179 238 58 OliveDrab2
435 154 205 50 OliveDrab3
436 105 139 34 OliveDrab4
437 202 255 112 DarkOliveGreen1
438 188 238 104 DarkOliveGreen2
439 162 205 90 DarkOliveGreen3
440 110 139 61 DarkOliveGreen4
445 255 236 139 LightGoldenrod1
446 238 220 130 LightGoldenrod2
447 205 190 112 LightGoldenrod3
448 139 129 76 LightGoldenrod4
449 255 255 224 LightYellow1
450 238 238 209 LightYellow2
451 205 205 180 LightYellow3
452 139 139 122 LightYellow4
461 255 193 37 goldenrod1
462 238 180 34 goldenrod2
463 205 155 29 goldenrod3
464 139 105 20 goldenrod4
465 255 185 15 DarkGoldenrod1
466 238 173 14 DarkGoldenrod2
467 205 149 12 DarkGoldenrod3
468 139 101 8 DarkGoldenrod4
469 255 193 193 RosyBrown1
470 238 180 180 RosyBrown2
471 205 155 155 RosyBrown3
472 139 105 105 RosyBrown4
473 255 106 106 IndianRed1
481 255 211 155 burlywood1
482 238 197 145 burlywood2
483 205 170 125 burlywood3
484 139 115 85 burlywood4
493 255 127 36 chocolate1
494 238 118 33 chocolate2
495 205 102 29 chocolate3
509 255 160 122 LightSalmon1
510 238 149 114 LightSalmon2
511 205 129 98 LightSalmon3
512 139 87 66 LightSalmon4
517 255 127 0 DarkOrange1
518 238 118 0 DarkOrange2
519 205 102 0 DarkOrange3
549 255 174 185 LightPink1
550 238 162 173 LightPink2
551 205 140 149 LightPink3
552 139 95 101 LightPink4
553 255 130 171 PaleVioletRed1
554 238 121 159 PaleVioletRed2
555 205 104 137 PaleVioletRed3
556 139 71 93 PaleVioletRed4
561 255 62 150 VioletRed1
562 238 58 140 VioletRed2
563 205 50 120 VioletRed3
577 224 102 255 MediumOrchid1
578 209 95 238 MediumOrchid2
579 180 82 205 MediumOrchid3
580 122 55 139 MediumOrchid4
581 191 62 255 DarkOrchid1
582 178 58 238 DarkOrchid2
583 154 50 205 DarkOrchid3
584 104 34 139 DarkOrchid4
589 171 130 255 MediumPurple1
590 159 121 238 MediumPurple2
591 137 104 205 MediumPurple3
592 93 71 139 MediumPurple4
799 169 169 169 dark grey
801 169 169 169 dark gray
807 139 0 139 dark magenta
808 139 0 139 DarkMagenta
811 144 238 144 light green
812 144 238 144 LightGreen
817 Imager::Color::Table - built-in Imager color table
821 use Imager::Color::Table;
822 my @rgb = Imager::Color::Table->get($name)
823 or die "Color $name not found";
827 This class provides a base color table for use in resolving color names.
829 The table contains the standard X11 C<rgb.txt> colors.
831 This table is not included as part of Imager::Color itself since it's
834 There is only one method:
840 my @rgb = Imager::Color::Table->get('red')
841 or die "No red found";
843 Retrieves a color from Imager::Color::Tables built-in color table.
849 Tony Cook <tony@develop-help.com>