1
/* named_colors.c - Named color values. */
3
* GRUB -- GRand Unified Bootloader
4
* Copyright (C) 2008 Free Software Foundation, Inc.
6
* GRUB is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* GRUB is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20
#include <grub/types.h>
22
#include <grub/gui_string_util.h>
23
#include <grub/misc.h>
28
grub_gui_color_t color;
32
Named color list generated from the list of SVG color keywords from
33
<http://www.w3.org/TR/css3-color/#svg-color>,
34
processed through the following Perl command:
35
perl -ne 'chomp;split;print "{ \"$_[0]\", RGB_COLOR($_[2]) },\n"'
38
#define RGB_COLOR(r,g,b) {.red = r, .green = g, .blue = b, .alpha = 255}
40
static struct named_color named_colors[] =
42
{ "aliceblue", RGB_COLOR(240,248,255) },
43
{ "antiquewhite", RGB_COLOR(250,235,215) },
44
{ "aqua", RGB_COLOR(0,255,255) },
45
{ "aquamarine", RGB_COLOR(127,255,212) },
46
{ "azure", RGB_COLOR(240,255,255) },
47
{ "beige", RGB_COLOR(245,245,220) },
48
{ "bisque", RGB_COLOR(255,228,196) },
49
{ "black", RGB_COLOR(0,0,0) },
50
{ "blanchedalmond", RGB_COLOR(255,235,205) },
51
{ "blue", RGB_COLOR(0,0,255) },
52
{ "blueviolet", RGB_COLOR(138,43,226) },
53
{ "brown", RGB_COLOR(165,42,42) },
54
{ "burlywood", RGB_COLOR(222,184,135) },
55
{ "cadetblue", RGB_COLOR(95,158,160) },
56
{ "chartreuse", RGB_COLOR(127,255,0) },
57
{ "chocolate", RGB_COLOR(210,105,30) },
58
{ "coral", RGB_COLOR(255,127,80) },
59
{ "cornflowerblue", RGB_COLOR(100,149,237) },
60
{ "cornsilk", RGB_COLOR(255,248,220) },
61
{ "crimson", RGB_COLOR(220,20,60) },
62
{ "cyan", RGB_COLOR(0,255,255) },
63
{ "darkblue", RGB_COLOR(0,0,139) },
64
{ "darkcyan", RGB_COLOR(0,139,139) },
65
{ "darkgoldenrod", RGB_COLOR(184,134,11) },
66
{ "darkgray", RGB_COLOR(169,169,169) },
67
{ "darkgreen", RGB_COLOR(0,100,0) },
68
{ "darkgrey", RGB_COLOR(169,169,169) },
69
{ "darkkhaki", RGB_COLOR(189,183,107) },
70
{ "darkmagenta", RGB_COLOR(139,0,139) },
71
{ "darkolivegreen", RGB_COLOR(85,107,47) },
72
{ "darkorange", RGB_COLOR(255,140,0) },
73
{ "darkorchid", RGB_COLOR(153,50,204) },
74
{ "darkred", RGB_COLOR(139,0,0) },
75
{ "darksalmon", RGB_COLOR(233,150,122) },
76
{ "darkseagreen", RGB_COLOR(143,188,143) },
77
{ "darkslateblue", RGB_COLOR(72,61,139) },
78
{ "darkslategray", RGB_COLOR(47,79,79) },
79
{ "darkslategrey", RGB_COLOR(47,79,79) },
80
{ "darkturquoise", RGB_COLOR(0,206,209) },
81
{ "darkviolet", RGB_COLOR(148,0,211) },
82
{ "deeppink", RGB_COLOR(255,20,147) },
83
{ "deepskyblue", RGB_COLOR(0,191,255) },
84
{ "dimgray", RGB_COLOR(105,105,105) },
85
{ "dimgrey", RGB_COLOR(105,105,105) },
86
{ "dodgerblue", RGB_COLOR(30,144,255) },
87
{ "firebrick", RGB_COLOR(178,34,34) },
88
{ "floralwhite", RGB_COLOR(255,250,240) },
89
{ "forestgreen", RGB_COLOR(34,139,34) },
90
{ "fuchsia", RGB_COLOR(255,0,255) },
91
{ "gainsboro", RGB_COLOR(220,220,220) },
92
{ "ghostwhite", RGB_COLOR(248,248,255) },
93
{ "gold", RGB_COLOR(255,215,0) },
94
{ "goldenrod", RGB_COLOR(218,165,32) },
95
{ "gray", RGB_COLOR(128,128,128) },
96
{ "green", RGB_COLOR(0,128,0) },
97
{ "greenyellow", RGB_COLOR(173,255,47) },
98
{ "grey", RGB_COLOR(128,128,128) },
99
{ "honeydew", RGB_COLOR(240,255,240) },
100
{ "hotpink", RGB_COLOR(255,105,180) },
101
{ "indianred", RGB_COLOR(205,92,92) },
102
{ "indigo", RGB_COLOR(75,0,130) },
103
{ "ivory", RGB_COLOR(255,255,240) },
104
{ "khaki", RGB_COLOR(240,230,140) },
105
{ "lavender", RGB_COLOR(230,230,250) },
106
{ "lavenderblush", RGB_COLOR(255,240,245) },
107
{ "lawngreen", RGB_COLOR(124,252,0) },
108
{ "lemonchiffon", RGB_COLOR(255,250,205) },
109
{ "lightblue", RGB_COLOR(173,216,230) },
110
{ "lightcoral", RGB_COLOR(240,128,128) },
111
{ "lightcyan", RGB_COLOR(224,255,255) },
112
{ "lightgoldenrodyellow", RGB_COLOR(250,250,210) },
113
{ "lightgray", RGB_COLOR(211,211,211) },
114
{ "lightgreen", RGB_COLOR(144,238,144) },
115
{ "lightgrey", RGB_COLOR(211,211,211) },
116
{ "lightpink", RGB_COLOR(255,182,193) },
117
{ "lightsalmon", RGB_COLOR(255,160,122) },
118
{ "lightseagreen", RGB_COLOR(32,178,170) },
119
{ "lightskyblue", RGB_COLOR(135,206,250) },
120
{ "lightslategray", RGB_COLOR(119,136,153) },
121
{ "lightslategrey", RGB_COLOR(119,136,153) },
122
{ "lightsteelblue", RGB_COLOR(176,196,222) },
123
{ "lightyellow", RGB_COLOR(255,255,224) },
124
{ "lime", RGB_COLOR(0,255,0) },
125
{ "limegreen", RGB_COLOR(50,205,50) },
126
{ "linen", RGB_COLOR(250,240,230) },
127
{ "magenta", RGB_COLOR(255,0,255) },
128
{ "maroon", RGB_COLOR(128,0,0) },
129
{ "mediumaquamarine", RGB_COLOR(102,205,170) },
130
{ "mediumblue", RGB_COLOR(0,0,205) },
131
{ "mediumorchid", RGB_COLOR(186,85,211) },
132
{ "mediumpurple", RGB_COLOR(147,112,219) },
133
{ "mediumseagreen", RGB_COLOR(60,179,113) },
134
{ "mediumslateblue", RGB_COLOR(123,104,238) },
135
{ "mediumspringgreen", RGB_COLOR(0,250,154) },
136
{ "mediumturquoise", RGB_COLOR(72,209,204) },
137
{ "mediumvioletred", RGB_COLOR(199,21,133) },
138
{ "midnightblue", RGB_COLOR(25,25,112) },
139
{ "mintcream", RGB_COLOR(245,255,250) },
140
{ "mistyrose", RGB_COLOR(255,228,225) },
141
{ "moccasin", RGB_COLOR(255,228,181) },
142
{ "navajowhite", RGB_COLOR(255,222,173) },
143
{ "navy", RGB_COLOR(0,0,128) },
144
{ "oldlace", RGB_COLOR(253,245,230) },
145
{ "olive", RGB_COLOR(128,128,0) },
146
{ "olivedrab", RGB_COLOR(107,142,35) },
147
{ "orange", RGB_COLOR(255,165,0) },
148
{ "orangered", RGB_COLOR(255,69,0) },
149
{ "orchid", RGB_COLOR(218,112,214) },
150
{ "palegoldenrod", RGB_COLOR(238,232,170) },
151
{ "palegreen", RGB_COLOR(152,251,152) },
152
{ "paleturquoise", RGB_COLOR(175,238,238) },
153
{ "palevioletred", RGB_COLOR(219,112,147) },
154
{ "papayawhip", RGB_COLOR(255,239,213) },
155
{ "peachpuff", RGB_COLOR(255,218,185) },
156
{ "peru", RGB_COLOR(205,133,63) },
157
{ "pink", RGB_COLOR(255,192,203) },
158
{ "plum", RGB_COLOR(221,160,221) },
159
{ "powderblue", RGB_COLOR(176,224,230) },
160
{ "purple", RGB_COLOR(128,0,128) },
161
{ "red", RGB_COLOR(255,0,0) },
162
{ "rosybrown", RGB_COLOR(188,143,143) },
163
{ "royalblue", RGB_COLOR(65,105,225) },
164
{ "saddlebrown", RGB_COLOR(139,69,19) },
165
{ "salmon", RGB_COLOR(250,128,114) },
166
{ "sandybrown", RGB_COLOR(244,164,96) },
167
{ "seagreen", RGB_COLOR(46,139,87) },
168
{ "seashell", RGB_COLOR(255,245,238) },
169
{ "sienna", RGB_COLOR(160,82,45) },
170
{ "silver", RGB_COLOR(192,192,192) },
171
{ "skyblue", RGB_COLOR(135,206,235) },
172
{ "slateblue", RGB_COLOR(106,90,205) },
173
{ "slategray", RGB_COLOR(112,128,144) },
174
{ "slategrey", RGB_COLOR(112,128,144) },
175
{ "snow", RGB_COLOR(255,250,250) },
176
{ "springgreen", RGB_COLOR(0,255,127) },
177
{ "steelblue", RGB_COLOR(70,130,180) },
178
{ "tan", RGB_COLOR(210,180,140) },
179
{ "teal", RGB_COLOR(0,128,128) },
180
{ "thistle", RGB_COLOR(216,191,216) },
181
{ "tomato", RGB_COLOR(255,99,71) },
182
{ "turquoise", RGB_COLOR(64,224,208) },
183
{ "violet", RGB_COLOR(238,130,238) },
184
{ "wheat", RGB_COLOR(245,222,179) },
185
{ "white", RGB_COLOR(255,255,255) },
186
{ "whitesmoke", RGB_COLOR(245,245,245) },
187
{ "yellow", RGB_COLOR(255,255,0) },
188
{ "yellowgreen", RGB_COLOR(154,205,50) },
189
{ 0, { 0, 0, 0, 0 } } /* Terminator. */
192
/* Get the color named NAME. If the color was found, returns 1 and
193
stores the color into *COLOR. If the color was not found, returns 0 and
194
does not modify *COLOR. */
196
grub_gui_get_named_color (const char *name,
197
grub_gui_color_t *color)
200
for (i = 0; named_colors[i].name; i++)
202
if (grub_strcmp (named_colors[i].name, name) == 0)
204
*color = named_colors[i].color;