1 /****************************************************************************
3 ** This file is based on sources of the Qt GUI Toolkit, used under the terms
4 ** of the GNU General Public License version 2 (see the original copyright
6 ** All further contributions to this file are (and are required to be)
7 ** licensed under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
11 ** The original Qt license header follows:
14 ** Named color support for non-X platforms.
15 ** The color names have been borrowed from X.
19 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
21 ** This file is part of the kernel module of the Qt GUI Toolkit.
23 ** This file may be distributed under the terms of the Q Public License
24 ** as defined by Trolltech AS of Norway and appearing in the file
25 ** LICENSE.QPL included in the packaging of this file.
27 ** This file may be distributed and/or modified under the terms of the
28 ** GNU General Public License version 2 as published by the Free Software
29 ** Foundation and appearing in the file LICENSE.GPL included in the
30 ** packaging of this file.
32 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
33 ** licenses may use this file in accordance with the Qt Commercial License
34 ** Agreement provided with the Software.
36 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
37 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
39 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
40 ** information about Qt Commercial License Agreements.
41 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
42 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
44 ** Contact info@trolltech.com if any conditions of this licensing are
47 **********************************************************************/
51 // needed for qsort() because of a std namespace problem on Borland
52 #include "qplatformdefs.h"
57 #ifndef QT_NO_COLORNAMES
64 #define QRGB(r,g,b) (r*65536 + g*256 + b)
66 const int rgbTblSize
= 657;
68 static int qstricmp( const char *str1
, const char *str2
)
70 register const uchar
*s1
= (const uchar
*)str1
;
71 register const uchar
*s2
= (const uchar
*)str2
;
75 return s1
? 1 : ( s2
? -1 : 0 );
76 for ( ; !(res
= (c
=tolower(*s1
)) - tolower(*s2
)); s1
++, s2
++ )
77 if ( !c
) // strings are equal
82 static const struct RGBData
{
86 { QRGB(240,248,255), "aliceblue" },
87 { QRGB(250,235,215), "antiquewhite" },
88 { QRGB(255,239,219), "antiquewhite1" },
89 { QRGB(238,223,204), "antiquewhite2" },
90 { QRGB(205,192,176), "antiquewhite3" },
91 { QRGB(139,131,120), "antiquewhite4" },
92 { QRGB(127,255,212), "aquamarine" },
93 { QRGB(127,255,212), "aquamarine1" },
94 { QRGB(118,238,198), "aquamarine2" },
95 { QRGB(102,205,170), "aquamarine3" },
96 { QRGB( 69,139,116), "aquamarine4" },
97 { QRGB(240,255,255), "azure" },
98 { QRGB(240,255,255), "azure1" },
99 { QRGB(224,238,238), "azure2" },
100 { QRGB(193,205,205), "azure3" },
101 { QRGB(131,139,139), "azure4" },
102 { QRGB(245,245,220), "beige" },
103 { QRGB(255,228,196), "bisque" },
104 { QRGB(255,228,196), "bisque1" },
105 { QRGB(238,213,183), "bisque2" },
106 { QRGB(205,183,158), "bisque3" },
107 { QRGB(139,125,107), "bisque4" },
108 { QRGB( 0, 0, 0), "black" },
109 { QRGB(255,235,205), "blanchedalmond" },
110 { QRGB( 0, 0,255), "blue" },
111 { QRGB( 0, 0,255), "blue1" },
112 { QRGB( 0, 0,238), "blue2" },
113 { QRGB( 0, 0,205), "blue3" },
114 { QRGB( 0, 0,139), "blue4" },
115 { QRGB(138, 43,226), "blueviolet" },
116 { QRGB(165, 42, 42), "brown" },
117 { QRGB(255, 64, 64), "brown1" },
118 { QRGB(238, 59, 59), "brown2" },
119 { QRGB(205, 51, 51), "brown3" },
120 { QRGB(139, 35, 35), "brown4" },
121 { QRGB(222,184,135), "burlywood" },
122 { QRGB(255,211,155), "burlywood1" },
123 { QRGB(238,197,145), "burlywood2" },
124 { QRGB(205,170,125), "burlywood3" },
125 { QRGB(139,115, 85), "burlywood4" },
126 { QRGB( 95,158,160), "cadetblue" },
127 { QRGB(152,245,255), "cadetblue1" },
128 { QRGB(142,229,238), "cadetblue2" },
129 { QRGB(122,197,205), "cadetblue3" },
130 { QRGB( 83,134,139), "cadetblue4" },
131 { QRGB(127,255, 0), "chartreuse" },
132 { QRGB(127,255, 0), "chartreuse1" },
133 { QRGB(118,238, 0), "chartreuse2" },
134 { QRGB(102,205, 0), "chartreuse3" },
135 { QRGB( 69,139, 0), "chartreuse4" },
136 { QRGB(210,105, 30), "chocolate" },
137 { QRGB(255,127, 36), "chocolate1" },
138 { QRGB(238,118, 33), "chocolate2" },
139 { QRGB(205,102, 29), "chocolate3" },
140 { QRGB(139, 69, 19), "chocolate4" },
141 { QRGB(255,127, 80), "coral" },
142 { QRGB(255,114, 86), "coral1" },
143 { QRGB(238,106, 80), "coral2" },
144 { QRGB(205, 91, 69), "coral3" },
145 { QRGB(139, 62, 47), "coral4" },
146 { QRGB(100,149,237), "cornflowerblue" },
147 { QRGB(255,248,220), "cornsilk" },
148 { QRGB(255,248,220), "cornsilk1" },
149 { QRGB(238,232,205), "cornsilk2" },
150 { QRGB(205,200,177), "cornsilk3" },
151 { QRGB(139,136,120), "cornsilk4" },
152 { QRGB( 0,255,255), "cyan" },
153 { QRGB( 0,255,255), "cyan1" },
154 { QRGB( 0,238,238), "cyan2" },
155 { QRGB( 0,205,205), "cyan3" },
156 { QRGB( 0,139,139), "cyan4" },
157 { QRGB( 0, 0,139), "darkblue" },
158 { QRGB( 0,139,139), "darkcyan" },
159 { QRGB(184,134, 11), "darkgoldenrod" },
160 { QRGB(255,185, 15), "darkgoldenrod1" },
161 { QRGB(238,173, 14), "darkgoldenrod2" },
162 { QRGB(205,149, 12), "darkgoldenrod3" },
163 { QRGB(139,101, 8), "darkgoldenrod4" },
164 { QRGB(169,169,169), "darkgray" },
165 { QRGB( 0,100, 0), "darkgreen" },
166 { QRGB(169,169,169), "darkgrey" },
167 { QRGB(189,183,107), "darkkhaki" },
168 { QRGB(139, 0,139), "darkmagenta" },
169 { QRGB( 85,107, 47), "darkolivegreen" },
170 { QRGB(202,255,112), "darkolivegreen1" },
171 { QRGB(188,238,104), "darkolivegreen2" },
172 { QRGB(162,205, 90), "darkolivegreen3" },
173 { QRGB(110,139, 61), "darkolivegreen4" },
174 { QRGB(255,140, 0), "darkorange" },
175 { QRGB(255,127, 0), "darkorange1" },
176 { QRGB(238,118, 0), "darkorange2" },
177 { QRGB(205,102, 0), "darkorange3" },
178 { QRGB(139, 69, 0), "darkorange4" },
179 { QRGB(153, 50,204), "darkorchid" },
180 { QRGB(191, 62,255), "darkorchid1" },
181 { QRGB(178, 58,238), "darkorchid2" },
182 { QRGB(154, 50,205), "darkorchid3" },
183 { QRGB(104, 34,139), "darkorchid4" },
184 { QRGB(139, 0, 0), "darkred" },
185 { QRGB(233,150,122), "darksalmon" },
186 { QRGB(143,188,143), "darkseagreen" },
187 { QRGB(193,255,193), "darkseagreen1" },
188 { QRGB(180,238,180), "darkseagreen2" },
189 { QRGB(155,205,155), "darkseagreen3" },
190 { QRGB(105,139,105), "darkseagreen4" },
191 { QRGB( 72, 61,139), "darkslateblue" },
192 { QRGB( 47, 79, 79), "darkslategray" },
193 { QRGB(151,255,255), "darkslategray1" },
194 { QRGB(141,238,238), "darkslategray2" },
195 { QRGB(121,205,205), "darkslategray3" },
196 { QRGB( 82,139,139), "darkslategray4" },
197 { QRGB( 47, 79, 79), "darkslategrey" },
198 { QRGB( 0,206,209), "darkturquoise" },
199 { QRGB(148, 0,211), "darkviolet" },
200 { QRGB(255, 20,147), "deeppink" },
201 { QRGB(255, 20,147), "deeppink1" },
202 { QRGB(238, 18,137), "deeppink2" },
203 { QRGB(205, 16,118), "deeppink3" },
204 { QRGB(139, 10, 80), "deeppink4" },
205 { QRGB( 0,191,255), "deepskyblue" },
206 { QRGB( 0,191,255), "deepskyblue1" },
207 { QRGB( 0,178,238), "deepskyblue2" },
208 { QRGB( 0,154,205), "deepskyblue3" },
209 { QRGB( 0,104,139), "deepskyblue4" },
210 { QRGB(105,105,105), "dimgray" },
211 { QRGB(105,105,105), "dimgrey" },
212 { QRGB( 30,144,255), "dodgerblue" },
213 { QRGB( 30,144,255), "dodgerblue1" },
214 { QRGB( 28,134,238), "dodgerblue2" },
215 { QRGB( 24,116,205), "dodgerblue3" },
216 { QRGB( 16, 78,139), "dodgerblue4" },
217 { QRGB(178, 34, 34), "firebrick" },
218 { QRGB(255, 48, 48), "firebrick1" },
219 { QRGB(238, 44, 44), "firebrick2" },
220 { QRGB(205, 38, 38), "firebrick3" },
221 { QRGB(139, 26, 26), "firebrick4" },
222 { QRGB(255,250,240), "floralwhite" },
223 { QRGB( 34,139, 34), "forestgreen" },
224 { QRGB(220,220,220), "gainsboro" },
225 { QRGB(248,248,255), "ghostwhite" },
226 { QRGB(255,215, 0), "gold" },
227 { QRGB(255,215, 0), "gold1" },
228 { QRGB(238,201, 0), "gold2" },
229 { QRGB(205,173, 0), "gold3" },
230 { QRGB(139,117, 0), "gold4" },
231 { QRGB(218,165, 32), "goldenrod" },
232 { QRGB(255,193, 37), "goldenrod1" },
233 { QRGB(238,180, 34), "goldenrod2" },
234 { QRGB(205,155, 29), "goldenrod3" },
235 { QRGB(139,105, 20), "goldenrod4" },
236 { QRGB(190,190,190), "gray" },
237 { QRGB( 0, 0, 0), "gray0" },
238 { QRGB( 3, 3, 3), "gray1" },
239 { QRGB( 26, 26, 26), "gray10" },
240 { QRGB(255,255,255), "gray100" },
241 { QRGB( 28, 28, 28), "gray11" },
242 { QRGB( 31, 31, 31), "gray12" },
243 { QRGB( 33, 33, 33), "gray13" },
244 { QRGB( 36, 36, 36), "gray14" },
245 { QRGB( 38, 38, 38), "gray15" },
246 { QRGB( 41, 41, 41), "gray16" },
247 { QRGB( 43, 43, 43), "gray17" },
248 { QRGB( 46, 46, 46), "gray18" },
249 { QRGB( 48, 48, 48), "gray19" },
250 { QRGB( 5, 5, 5), "gray2" },
251 { QRGB( 51, 51, 51), "gray20" },
252 { QRGB( 54, 54, 54), "gray21" },
253 { QRGB( 56, 56, 56), "gray22" },
254 { QRGB( 59, 59, 59), "gray23" },
255 { QRGB( 61, 61, 61), "gray24" },
256 { QRGB( 64, 64, 64), "gray25" },
257 { QRGB( 66, 66, 66), "gray26" },
258 { QRGB( 69, 69, 69), "gray27" },
259 { QRGB( 71, 71, 71), "gray28" },
260 { QRGB( 74, 74, 74), "gray29" },
261 { QRGB( 8, 8, 8), "gray3" },
262 { QRGB( 77, 77, 77), "gray30" },
263 { QRGB( 79, 79, 79), "gray31" },
264 { QRGB( 82, 82, 82), "gray32" },
265 { QRGB( 84, 84, 84), "gray33" },
266 { QRGB( 87, 87, 87), "gray34" },
267 { QRGB( 89, 89, 89), "gray35" },
268 { QRGB( 92, 92, 92), "gray36" },
269 { QRGB( 94, 94, 94), "gray37" },
270 { QRGB( 97, 97, 97), "gray38" },
271 { QRGB( 99, 99, 99), "gray39" },
272 { QRGB( 10, 10, 10), "gray4" },
273 { QRGB(102,102,102), "gray40" },
274 { QRGB(105,105,105), "gray41" },
275 { QRGB(107,107,107), "gray42" },
276 { QRGB(110,110,110), "gray43" },
277 { QRGB(112,112,112), "gray44" },
278 { QRGB(115,115,115), "gray45" },
279 { QRGB(117,117,117), "gray46" },
280 { QRGB(120,120,120), "gray47" },
281 { QRGB(122,122,122), "gray48" },
282 { QRGB(125,125,125), "gray49" },
283 { QRGB( 13, 13, 13), "gray5" },
284 { QRGB(127,127,127), "gray50" },
285 { QRGB(130,130,130), "gray51" },
286 { QRGB(133,133,133), "gray52" },
287 { QRGB(135,135,135), "gray53" },
288 { QRGB(138,138,138), "gray54" },
289 { QRGB(140,140,140), "gray55" },
290 { QRGB(143,143,143), "gray56" },
291 { QRGB(145,145,145), "gray57" },
292 { QRGB(148,148,148), "gray58" },
293 { QRGB(150,150,150), "gray59" },
294 { QRGB( 15, 15, 15), "gray6" },
295 { QRGB(153,153,153), "gray60" },
296 { QRGB(156,156,156), "gray61" },
297 { QRGB(158,158,158), "gray62" },
298 { QRGB(161,161,161), "gray63" },
299 { QRGB(163,163,163), "gray64" },
300 { QRGB(166,166,166), "gray65" },
301 { QRGB(168,168,168), "gray66" },
302 { QRGB(171,171,171), "gray67" },
303 { QRGB(173,173,173), "gray68" },
304 { QRGB(176,176,176), "gray69" },
305 { QRGB( 18, 18, 18), "gray7" },
306 { QRGB(179,179,179), "gray70" },
307 { QRGB(181,181,181), "gray71" },
308 { QRGB(184,184,184), "gray72" },
309 { QRGB(186,186,186), "gray73" },
310 { QRGB(189,189,189), "gray74" },
311 { QRGB(191,191,191), "gray75" },
312 { QRGB(194,194,194), "gray76" },
313 { QRGB(196,196,196), "gray77" },
314 { QRGB(199,199,199), "gray78" },
315 { QRGB(201,201,201), "gray79" },
316 { QRGB( 20, 20, 20), "gray8" },
317 { QRGB(204,204,204), "gray80" },
318 { QRGB(207,207,207), "gray81" },
319 { QRGB(209,209,209), "gray82" },
320 { QRGB(212,212,212), "gray83" },
321 { QRGB(214,214,214), "gray84" },
322 { QRGB(217,217,217), "gray85" },
323 { QRGB(219,219,219), "gray86" },
324 { QRGB(222,222,222), "gray87" },
325 { QRGB(224,224,224), "gray88" },
326 { QRGB(227,227,227), "gray89" },
327 { QRGB( 23, 23, 23), "gray9" },
328 { QRGB(229,229,229), "gray90" },
329 { QRGB(232,232,232), "gray91" },
330 { QRGB(235,235,235), "gray92" },
331 { QRGB(237,237,237), "gray93" },
332 { QRGB(240,240,240), "gray94" },
333 { QRGB(242,242,242), "gray95" },
334 { QRGB(245,245,245), "gray96" },
335 { QRGB(247,247,247), "gray97" },
336 { QRGB(250,250,250), "gray98" },
337 { QRGB(252,252,252), "gray99" },
338 { QRGB( 0,255, 0), "green" },
339 { QRGB( 0,255, 0), "green1" },
340 { QRGB( 0,238, 0), "green2" },
341 { QRGB( 0,205, 0), "green3" },
342 { QRGB( 0,139, 0), "green4" },
343 { QRGB(173,255, 47), "greenyellow" },
344 { QRGB(190,190,190), "grey" },
345 { QRGB( 0, 0, 0), "grey0" },
346 { QRGB( 3, 3, 3), "grey1" },
347 { QRGB( 26, 26, 26), "grey10" },
348 { QRGB(255,255,255), "grey100" },
349 { QRGB( 28, 28, 28), "grey11" },
350 { QRGB( 31, 31, 31), "grey12" },
351 { QRGB( 33, 33, 33), "grey13" },
352 { QRGB( 36, 36, 36), "grey14" },
353 { QRGB( 38, 38, 38), "grey15" },
354 { QRGB( 41, 41, 41), "grey16" },
355 { QRGB( 43, 43, 43), "grey17" },
356 { QRGB( 46, 46, 46), "grey18" },
357 { QRGB( 48, 48, 48), "grey19" },
358 { QRGB( 5, 5, 5), "grey2" },
359 { QRGB( 51, 51, 51), "grey20" },
360 { QRGB( 54, 54, 54), "grey21" },
361 { QRGB( 56, 56, 56), "grey22" },
362 { QRGB( 59, 59, 59), "grey23" },
363 { QRGB( 61, 61, 61), "grey24" },
364 { QRGB( 64, 64, 64), "grey25" },
365 { QRGB( 66, 66, 66), "grey26" },
366 { QRGB( 69, 69, 69), "grey27" },
367 { QRGB( 71, 71, 71), "grey28" },
368 { QRGB( 74, 74, 74), "grey29" },
369 { QRGB( 8, 8, 8), "grey3" },
370 { QRGB( 77, 77, 77), "grey30" },
371 { QRGB( 79, 79, 79), "grey31" },
372 { QRGB( 82, 82, 82), "grey32" },
373 { QRGB( 84, 84, 84), "grey33" },
374 { QRGB( 87, 87, 87), "grey34" },
375 { QRGB( 89, 89, 89), "grey35" },
376 { QRGB( 92, 92, 92), "grey36" },
377 { QRGB( 94, 94, 94), "grey37" },
378 { QRGB( 97, 97, 97), "grey38" },
379 { QRGB( 99, 99, 99), "grey39" },
380 { QRGB( 10, 10, 10), "grey4" },
381 { QRGB(102,102,102), "grey40" },
382 { QRGB(105,105,105), "grey41" },
383 { QRGB(107,107,107), "grey42" },
384 { QRGB(110,110,110), "grey43" },
385 { QRGB(112,112,112), "grey44" },
386 { QRGB(115,115,115), "grey45" },
387 { QRGB(117,117,117), "grey46" },
388 { QRGB(120,120,120), "grey47" },
389 { QRGB(122,122,122), "grey48" },
390 { QRGB(125,125,125), "grey49" },
391 { QRGB( 13, 13, 13), "grey5" },
392 { QRGB(127,127,127), "grey50" },
393 { QRGB(130,130,130), "grey51" },
394 { QRGB(133,133,133), "grey52" },
395 { QRGB(135,135,135), "grey53" },
396 { QRGB(138,138,138), "grey54" },
397 { QRGB(140,140,140), "grey55" },
398 { QRGB(143,143,143), "grey56" },
399 { QRGB(145,145,145), "grey57" },
400 { QRGB(148,148,148), "grey58" },
401 { QRGB(150,150,150), "grey59" },
402 { QRGB( 15, 15, 15), "grey6" },
403 { QRGB(153,153,153), "grey60" },
404 { QRGB(156,156,156), "grey61" },
405 { QRGB(158,158,158), "grey62" },
406 { QRGB(161,161,161), "grey63" },
407 { QRGB(163,163,163), "grey64" },
408 { QRGB(166,166,166), "grey65" },
409 { QRGB(168,168,168), "grey66" },
410 { QRGB(171,171,171), "grey67" },
411 { QRGB(173,173,173), "grey68" },
412 { QRGB(176,176,176), "grey69" },
413 { QRGB( 18, 18, 18), "grey7" },
414 { QRGB(179,179,179), "grey70" },
415 { QRGB(181,181,181), "grey71" },
416 { QRGB(184,184,184), "grey72" },
417 { QRGB(186,186,186), "grey73" },
418 { QRGB(189,189,189), "grey74" },
419 { QRGB(191,191,191), "grey75" },
420 { QRGB(194,194,194), "grey76" },
421 { QRGB(196,196,196), "grey77" },
422 { QRGB(199,199,199), "grey78" },
423 { QRGB(201,201,201), "grey79" },
424 { QRGB( 20, 20, 20), "grey8" },
425 { QRGB(204,204,204), "grey80" },
426 { QRGB(207,207,207), "grey81" },
427 { QRGB(209,209,209), "grey82" },
428 { QRGB(212,212,212), "grey83" },
429 { QRGB(214,214,214), "grey84" },
430 { QRGB(217,217,217), "grey85" },
431 { QRGB(219,219,219), "grey86" },
432 { QRGB(222,222,222), "grey87" },
433 { QRGB(224,224,224), "grey88" },
434 { QRGB(227,227,227), "grey89" },
435 { QRGB( 23, 23, 23), "grey9" },
436 { QRGB(229,229,229), "grey90" },
437 { QRGB(232,232,232), "grey91" },
438 { QRGB(235,235,235), "grey92" },
439 { QRGB(237,237,237), "grey93" },
440 { QRGB(240,240,240), "grey94" },
441 { QRGB(242,242,242), "grey95" },
442 { QRGB(245,245,245), "grey96" },
443 { QRGB(247,247,247), "grey97" },
444 { QRGB(250,250,250), "grey98" },
445 { QRGB(252,252,252), "grey99" },
446 { QRGB(240,255,240), "honeydew" },
447 { QRGB(240,255,240), "honeydew1" },
448 { QRGB(224,238,224), "honeydew2" },
449 { QRGB(193,205,193), "honeydew3" },
450 { QRGB(131,139,131), "honeydew4" },
451 { QRGB(255,105,180), "hotpink" },
452 { QRGB(255,110,180), "hotpink1" },
453 { QRGB(238,106,167), "hotpink2" },
454 { QRGB(205, 96,144), "hotpink3" },
455 { QRGB(139, 58, 98), "hotpink4" },
456 { QRGB(205, 92, 92), "indianred" },
457 { QRGB(255,106,106), "indianred1" },
458 { QRGB(238, 99, 99), "indianred2" },
459 { QRGB(205, 85, 85), "indianred3" },
460 { QRGB(139, 58, 58), "indianred4" },
461 { QRGB(255,255,240), "ivory" },
462 { QRGB(255,255,240), "ivory1" },
463 { QRGB(238,238,224), "ivory2" },
464 { QRGB(205,205,193), "ivory3" },
465 { QRGB(139,139,131), "ivory4" },
466 { QRGB(240,230,140), "khaki" },
467 { QRGB(255,246,143), "khaki1" },
468 { QRGB(238,230,133), "khaki2" },
469 { QRGB(205,198,115), "khaki3" },
470 { QRGB(139,134, 78), "khaki4" },
471 { QRGB(230,230,250), "lavender" },
472 { QRGB(255,240,245), "lavenderblush" },
473 { QRGB(255,240,245), "lavenderblush1" },
474 { QRGB(238,224,229), "lavenderblush2" },
475 { QRGB(205,193,197), "lavenderblush3" },
476 { QRGB(139,131,134), "lavenderblush4" },
477 { QRGB(124,252, 0), "lawngreen" },
478 { QRGB(255,250,205), "lemonchiffon" },
479 { QRGB(255,250,205), "lemonchiffon1" },
480 { QRGB(238,233,191), "lemonchiffon2" },
481 { QRGB(205,201,165), "lemonchiffon3" },
482 { QRGB(139,137,112), "lemonchiffon4" },
483 { QRGB(173,216,230), "lightblue" },
484 { QRGB(191,239,255), "lightblue1" },
485 { QRGB(178,223,238), "lightblue2" },
486 { QRGB(154,192,205), "lightblue3" },
487 { QRGB(104,131,139), "lightblue4" },
488 { QRGB(240,128,128), "lightcoral" },
489 { QRGB(224,255,255), "lightcyan" },
490 { QRGB(224,255,255), "lightcyan1" },
491 { QRGB(209,238,238), "lightcyan2" },
492 { QRGB(180,205,205), "lightcyan3" },
493 { QRGB(122,139,139), "lightcyan4" },
494 { QRGB(238,221,130), "lightgoldenrod" },
495 { QRGB(255,236,139), "lightgoldenrod1" },
496 { QRGB(238,220,130), "lightgoldenrod2" },
497 { QRGB(205,190,112), "lightgoldenrod3" },
498 { QRGB(139,129, 76), "lightgoldenrod4" },
499 { QRGB(250,250,210), "lightgoldenrodyellow" },
500 { QRGB(211,211,211), "lightgray" },
501 { QRGB(144,238,144), "lightgreen" },
502 { QRGB(211,211,211), "lightgrey" },
503 { QRGB(255,182,193), "lightpink" },
504 { QRGB(255,174,185), "lightpink1" },
505 { QRGB(238,162,173), "lightpink2" },
506 { QRGB(205,140,149), "lightpink3" },
507 { QRGB(139, 95,101), "lightpink4" },
508 { QRGB(255,160,122), "lightsalmon" },
509 { QRGB(255,160,122), "lightsalmon1" },
510 { QRGB(238,149,114), "lightsalmon2" },
511 { QRGB(205,129, 98), "lightsalmon3" },
512 { QRGB(139, 87, 66), "lightsalmon4" },
513 { QRGB( 32,178,170), "lightseagreen" },
514 { QRGB(135,206,250), "lightskyblue" },
515 { QRGB(176,226,255), "lightskyblue1" },
516 { QRGB(164,211,238), "lightskyblue2" },
517 { QRGB(141,182,205), "lightskyblue3" },
518 { QRGB( 96,123,139), "lightskyblue4" },
519 { QRGB(132,112,255), "lightslateblue" },
520 { QRGB(119,136,153), "lightslategray" },
521 { QRGB(119,136,153), "lightslategrey" },
522 { QRGB(176,196,222), "lightsteelblue" },
523 { QRGB(202,225,255), "lightsteelblue1" },
524 { QRGB(188,210,238), "lightsteelblue2" },
525 { QRGB(162,181,205), "lightsteelblue3" },
526 { QRGB(110,123,139), "lightsteelblue4" },
527 { QRGB(255,255,224), "lightyellow" },
528 { QRGB(255,255,224), "lightyellow1" },
529 { QRGB(238,238,209), "lightyellow2" },
530 { QRGB(205,205,180), "lightyellow3" },
531 { QRGB(139,139,122), "lightyellow4" },
532 { QRGB( 50,205, 50), "limegreen" },
533 { QRGB(250,240,230), "linen" },
534 { QRGB(255, 0,255), "magenta" },
535 { QRGB(255, 0,255), "magenta1" },
536 { QRGB(238, 0,238), "magenta2" },
537 { QRGB(205, 0,205), "magenta3" },
538 { QRGB(139, 0,139), "magenta4" },
539 { QRGB(176, 48, 96), "maroon" },
540 { QRGB(255, 52,179), "maroon1" },
541 { QRGB(238, 48,167), "maroon2" },
542 { QRGB(205, 41,144), "maroon3" },
543 { QRGB(139, 28, 98), "maroon4" },
544 { QRGB(102,205,170), "mediumaquamarine" },
545 { QRGB( 0, 0,205), "mediumblue" },
546 { QRGB(186, 85,211), "mediumorchid" },
547 { QRGB(224,102,255), "mediumorchid1" },
548 { QRGB(209, 95,238), "mediumorchid2" },
549 { QRGB(180, 82,205), "mediumorchid3" },
550 { QRGB(122, 55,139), "mediumorchid4" },
551 { QRGB(147,112,219), "mediumpurple" },
552 { QRGB(171,130,255), "mediumpurple1" },
553 { QRGB(159,121,238), "mediumpurple2" },
554 { QRGB(137,104,205), "mediumpurple3" },
555 { QRGB( 93, 71,139), "mediumpurple4" },
556 { QRGB( 60,179,113), "mediumseagreen" },
557 { QRGB(123,104,238), "mediumslateblue" },
558 { QRGB( 0,250,154), "mediumspringgreen" },
559 { QRGB( 72,209,204), "mediumturquoise" },
560 { QRGB(199, 21,133), "mediumvioletred" },
561 { QRGB( 25, 25,112), "midnightblue" },
562 { QRGB(245,255,250), "mintcream" },
563 { QRGB(255,228,225), "mistyrose" },
564 { QRGB(255,228,225), "mistyrose1" },
565 { QRGB(238,213,210), "mistyrose2" },
566 { QRGB(205,183,181), "mistyrose3" },
567 { QRGB(139,125,123), "mistyrose4" },
568 { QRGB(255,228,181), "moccasin" },
569 { QRGB(255,222,173), "navajowhite" },
570 { QRGB(255,222,173), "navajowhite1" },
571 { QRGB(238,207,161), "navajowhite2" },
572 { QRGB(205,179,139), "navajowhite3" },
573 { QRGB(139,121, 94), "navajowhite4" },
574 { QRGB( 0, 0,128), "navy" },
575 { QRGB( 0, 0,128), "navyblue" },
576 { QRGB(253,245,230), "oldlace" },
577 { QRGB(107,142, 35), "olivedrab" },
578 { QRGB(192,255, 62), "olivedrab1" },
579 { QRGB(179,238, 58), "olivedrab2" },
580 { QRGB(154,205, 50), "olivedrab3" },
581 { QRGB(105,139, 34), "olivedrab4" },
582 { QRGB(255,165, 0), "orange" },
583 { QRGB(255,165, 0), "orange1" },
584 { QRGB(238,154, 0), "orange2" },
585 { QRGB(205,133, 0), "orange3" },
586 { QRGB(139, 90, 0), "orange4" },
587 { QRGB(255, 69, 0), "orangered" },
588 { QRGB(255, 69, 0), "orangered1" },
589 { QRGB(238, 64, 0), "orangered2" },
590 { QRGB(205, 55, 0), "orangered3" },
591 { QRGB(139, 37, 0), "orangered4" },
592 { QRGB(218,112,214), "orchid" },
593 { QRGB(255,131,250), "orchid1" },
594 { QRGB(238,122,233), "orchid2" },
595 { QRGB(205,105,201), "orchid3" },
596 { QRGB(139, 71,137), "orchid4" },
597 { QRGB(238,232,170), "palegoldenrod" },
598 { QRGB(152,251,152), "palegreen" },
599 { QRGB(154,255,154), "palegreen1" },
600 { QRGB(144,238,144), "palegreen2" },
601 { QRGB(124,205,124), "palegreen3" },
602 { QRGB( 84,139, 84), "palegreen4" },
603 { QRGB(175,238,238), "paleturquoise" },
604 { QRGB(187,255,255), "paleturquoise1" },
605 { QRGB(174,238,238), "paleturquoise2" },
606 { QRGB(150,205,205), "paleturquoise3" },
607 { QRGB(102,139,139), "paleturquoise4" },
608 { QRGB(219,112,147), "palevioletred" },
609 { QRGB(255,130,171), "palevioletred1" },
610 { QRGB(238,121,159), "palevioletred2" },
611 { QRGB(205,104,137), "palevioletred3" },
612 { QRGB(139, 71, 93), "palevioletred4" },
613 { QRGB(255,239,213), "papayawhip" },
614 { QRGB(255,218,185), "peachpuff" },
615 { QRGB(255,218,185), "peachpuff1" },
616 { QRGB(238,203,173), "peachpuff2" },
617 { QRGB(205,175,149), "peachpuff3" },
618 { QRGB(139,119,101), "peachpuff4" },
619 { QRGB(205,133, 63), "peru" },
620 { QRGB(255,192,203), "pink" },
621 { QRGB(255,181,197), "pink1" },
622 { QRGB(238,169,184), "pink2" },
623 { QRGB(205,145,158), "pink3" },
624 { QRGB(139, 99,108), "pink4" },
625 { QRGB(221,160,221), "plum" },
626 { QRGB(255,187,255), "plum1" },
627 { QRGB(238,174,238), "plum2" },
628 { QRGB(205,150,205), "plum3" },
629 { QRGB(139,102,139), "plum4" },
630 { QRGB(176,224,230), "powderblue" },
631 { QRGB(160, 32,240), "purple" },
632 { QRGB(155, 48,255), "purple1" },
633 { QRGB(145, 44,238), "purple2" },
634 { QRGB(125, 38,205), "purple3" },
635 { QRGB( 85, 26,139), "purple4" },
636 { QRGB(255, 0, 0), "red" },
637 { QRGB(255, 0, 0), "red1" },
638 { QRGB(238, 0, 0), "red2" },
639 { QRGB(205, 0, 0), "red3" },
640 { QRGB(139, 0, 0), "red4" },
641 { QRGB(188,143,143), "rosybrown" },
642 { QRGB(255,193,193), "rosybrown1" },
643 { QRGB(238,180,180), "rosybrown2" },
644 { QRGB(205,155,155), "rosybrown3" },
645 { QRGB(139,105,105), "rosybrown4" },
646 { QRGB( 65,105,225), "royalblue" },
647 { QRGB( 72,118,255), "royalblue1" },
648 { QRGB( 67,110,238), "royalblue2" },
649 { QRGB( 58, 95,205), "royalblue3" },
650 { QRGB( 39, 64,139), "royalblue4" },
651 { QRGB(139, 69, 19), "saddlebrown" },
652 { QRGB(250,128,114), "salmon" },
653 { QRGB(255,140,105), "salmon1" },
654 { QRGB(238,130, 98), "salmon2" },
655 { QRGB(205,112, 84), "salmon3" },
656 { QRGB(139, 76, 57), "salmon4" },
657 { QRGB(244,164, 96), "sandybrown" },
658 { QRGB( 46,139, 87), "seagreen" },
659 { QRGB( 84,255,159), "seagreen1" },
660 { QRGB( 78,238,148), "seagreen2" },
661 { QRGB( 67,205,128), "seagreen3" },
662 { QRGB( 46,139, 87), "seagreen4" },
663 { QRGB(255,245,238), "seashell" },
664 { QRGB(255,245,238), "seashell1" },
665 { QRGB(238,229,222), "seashell2" },
666 { QRGB(205,197,191), "seashell3" },
667 { QRGB(139,134,130), "seashell4" },
668 { QRGB(160, 82, 45), "sienna" },
669 { QRGB(255,130, 71), "sienna1" },
670 { QRGB(238,121, 66), "sienna2" },
671 { QRGB(205,104, 57), "sienna3" },
672 { QRGB(139, 71, 38), "sienna4" },
673 { QRGB(135,206,235), "skyblue" },
674 { QRGB(135,206,255), "skyblue1" },
675 { QRGB(126,192,238), "skyblue2" },
676 { QRGB(108,166,205), "skyblue3" },
677 { QRGB( 74,112,139), "skyblue4" },
678 { QRGB(106, 90,205), "slateblue" },
679 { QRGB(131,111,255), "slateblue1" },
680 { QRGB(122,103,238), "slateblue2" },
681 { QRGB(105, 89,205), "slateblue3" },
682 { QRGB( 71, 60,139), "slateblue4" },
683 { QRGB(112,128,144), "slategray" },
684 { QRGB(198,226,255), "slategray1" },
685 { QRGB(185,211,238), "slategray2" },
686 { QRGB(159,182,205), "slategray3" },
687 { QRGB(108,123,139), "slategray4" },
688 { QRGB(112,128,144), "slategrey" },
689 { QRGB(255,250,250), "snow" },
690 { QRGB(255,250,250), "snow1" },
691 { QRGB(238,233,233), "snow2" },
692 { QRGB(205,201,201), "snow3" },
693 { QRGB(139,137,137), "snow4" },
694 { QRGB( 0,255,127), "springgreen" },
695 { QRGB( 0,255,127), "springgreen1" },
696 { QRGB( 0,238,118), "springgreen2" },
697 { QRGB( 0,205,102), "springgreen3" },
698 { QRGB( 0,139, 69), "springgreen4" },
699 { QRGB( 70,130,180), "steelblue" },
700 { QRGB( 99,184,255), "steelblue1" },
701 { QRGB( 92,172,238), "steelblue2" },
702 { QRGB( 79,148,205), "steelblue3" },
703 { QRGB( 54,100,139), "steelblue4" },
704 { QRGB(210,180,140), "tan" },
705 { QRGB(255,165, 79), "tan1" },
706 { QRGB(238,154, 73), "tan2" },
707 { QRGB(205,133, 63), "tan3" },
708 { QRGB(139, 90, 43), "tan4" },
709 { QRGB(216,191,216), "thistle" },
710 { QRGB(255,225,255), "thistle1" },
711 { QRGB(238,210,238), "thistle2" },
712 { QRGB(205,181,205), "thistle3" },
713 { QRGB(139,123,139), "thistle4" },
714 { QRGB(255, 99, 71), "tomato" },
715 { QRGB(255, 99, 71), "tomato1" },
716 { QRGB(238, 92, 66), "tomato2" },
717 { QRGB(205, 79, 57), "tomato3" },
718 { QRGB(139, 54, 38), "tomato4" },
719 { QRGB( 64,224,208), "turquoise" },
720 { QRGB( 0,245,255), "turquoise1" },
721 { QRGB( 0,229,238), "turquoise2" },
722 { QRGB( 0,197,205), "turquoise3" },
723 { QRGB( 0,134,139), "turquoise4" },
724 { QRGB(238,130,238), "violet" },
725 { QRGB(208, 32,144), "violetred" },
726 { QRGB(255, 62,150), "violetred1" },
727 { QRGB(238, 58,140), "violetred2" },
728 { QRGB(205, 50,120), "violetred3" },
729 { QRGB(139, 34, 82), "violetred4" },
730 { QRGB(245,222,179), "wheat" },
731 { QRGB(255,231,186), "wheat1" },
732 { QRGB(238,216,174), "wheat2" },
733 { QRGB(205,186,150), "wheat3" },
734 { QRGB(139,126,102), "wheat4" },
735 { QRGB(255,255,255), "white" },
736 { QRGB(245,245,245), "whitesmoke" },
737 { QRGB(255,255, 0), "yellow" },
738 { QRGB(255,255, 0), "yellow1" },
739 { QRGB(238,238, 0), "yellow2" },
740 { QRGB(205,205, 0), "yellow3" },
741 { QRGB(139,139, 0), "yellow4" },
742 { QRGB(154,205, 50), "yellowgreen" } };
744 #if defined(Q_C_CALLBACKS)
749 static int __cdecl
rgb_cmp( const void *d1
, const void *d2
)
751 static int rgb_cmp( const void *d1
, const void *d2
)
754 return qstricmp( ((RGBData
*)d1
)->name
, ((RGBData
*)d2
)->name
);
757 #if defined(Q_C_CALLBACKS)
761 bool qt_get_named_rgb( const char *name
, QRgb
* rgb
)
763 Q_LONG len
= strlen(name
)+1;
764 char *name_no_space
= (char *)malloc(len
);
765 for(Q_LONG o
=0,i
=0; i
< len
; i
++) {
766 if(name
[i
] != '\t' && name
[i
] != ' ')
767 name_no_space
[o
++] = name
[i
];
771 x
.name
= name_no_space
;
772 // Function bsearch() is supposed to be
773 // void *bsearch(const void *key, const void *base, ...
774 // So why (char*)? Are there broken bsearch() declarations out there?
775 RGBData
*r
= (RGBData
*)bsearch((char*)&x
, (char*)rgbTbl
, rgbTblSize
,
776 sizeof(RGBData
), rgb_cmp
);
786 uint
qt_get_rgb_val( const char *name
)
789 qt_get_named_rgb(name
,&r
);
792 #ifndef QT_NO_STRINGLIST
793 QStringList
QColor::colorNames()
797 for ( i
= 0; i
< rgbTblSize
; i
++ )
798 lst
<< rgbTbl
[i
].name
;
805 bool qt_get_named_rgb( const char *, QRgb
* )
810 uint
qt_get_rgb_val( const char * )
814 #ifndef QT_NO_STRINGLIST
815 QStringList
QColor::colorNames()
817 return QStringList();
820 #endif // QT_NO_COLORNAMES