1 | /**************************************************************************/ |
2 | /* color_names.inc */ |
3 | /**************************************************************************/ |
4 | /* This file is part of: */ |
5 | /* GODOT ENGINE */ |
6 | /* https://godotengine.org */ |
7 | /**************************************************************************/ |
8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
10 | /* */ |
11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
12 | /* a copy of this software and associated documentation files (the */ |
13 | /* "Software"), to deal in the Software without restriction, including */ |
14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
17 | /* the following conditions: */ |
18 | /* */ |
19 | /* The above copyright notice and this permission notice shall be */ |
20 | /* included in all copies or substantial portions of the Software. */ |
21 | /* */ |
22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
29 | /**************************************************************************/ |
30 | |
31 | // Names from https://en.wikipedia.org/wiki/X11_color_names |
32 | |
33 | // So this in a way that does not require memory allocation |
34 | // the old way leaked memory |
35 | // this is not used as often as for more performance to make sense |
36 | |
37 | struct NamedColor { |
38 | const char *name; |
39 | Color color; |
40 | }; |
41 | |
42 | // NOTE: This data is duplicated in the file: |
43 | // modules/mono/glue/GodotSharp/GodotSharp/Core/Colors.cs |
44 | |
45 | static NamedColor named_colors[] = { |
46 | { "ALICE_BLUE" , Color::hex(0xF0F8FFFF) }, |
47 | { "ANTIQUE_WHITE" , Color::hex(0xFAEBD7FF) }, |
48 | { "AQUA" , Color::hex(0x00FFFFFF) }, |
49 | { "AQUAMARINE" , Color::hex(0x7FFFD4FF) }, |
50 | { "AZURE" , Color::hex(0xF0FFFFFF) }, |
51 | { "BEIGE" , Color::hex(0xF5F5DCFF) }, |
52 | { "BISQUE" , Color::hex(0xFFE4C4FF) }, |
53 | { "BLACK" , Color::hex(0x000000FF) }, |
54 | { "BLANCHED_ALMOND" , Color::hex(0xFFEBCDFF) }, |
55 | { "BLUE" , Color::hex(0x0000FFFF) }, |
56 | { "BLUE_VIOLET" , Color::hex(0x8A2BE2FF) }, |
57 | { "BROWN" , Color::hex(0xA52A2AFF) }, |
58 | { "BURLYWOOD" , Color::hex(0xDEB887FF) }, |
59 | { "CADET_BLUE" , Color::hex(0x5F9EA0FF) }, |
60 | { "CHARTREUSE" , Color::hex(0x7FFF00FF) }, |
61 | { "CHOCOLATE" , Color::hex(0xD2691EFF) }, |
62 | { "CORAL" , Color::hex(0xFF7F50FF) }, |
63 | { "CORNFLOWER_BLUE" , Color::hex(0x6495EDFF) }, |
64 | { "CORNSILK" , Color::hex(0xFFF8DCFF) }, |
65 | { "CRIMSON" , Color::hex(0xDC143CFF) }, |
66 | { "CYAN" , Color::hex(0x00FFFFFF) }, |
67 | { "DARK_BLUE" , Color::hex(0x00008BFF) }, |
68 | { "DARK_CYAN" , Color::hex(0x008B8BFF) }, |
69 | { "DARK_GOLDENROD" , Color::hex(0xB8860BFF) }, |
70 | { "DARK_GRAY" , Color::hex(0xA9A9A9FF) }, |
71 | { "DARK_GREEN" , Color::hex(0x006400FF) }, |
72 | { "DARK_KHAKI" , Color::hex(0xBDB76BFF) }, |
73 | { "DARK_MAGENTA" , Color::hex(0x8B008BFF) }, |
74 | { "DARK_OLIVE_GREEN" , Color::hex(0x556B2FFF) }, |
75 | { "DARK_ORANGE" , Color::hex(0xFF8C00FF) }, |
76 | { "DARK_ORCHID" , Color::hex(0x9932CCFF) }, |
77 | { "DARK_RED" , Color::hex(0x8B0000FF) }, |
78 | { "DARK_SALMON" , Color::hex(0xE9967AFF) }, |
79 | { "DARK_SEA_GREEN" , Color::hex(0x8FBC8FFF) }, |
80 | { "DARK_SLATE_BLUE" , Color::hex(0x483D8BFF) }, |
81 | { "DARK_SLATE_GRAY" , Color::hex(0x2F4F4FFF) }, |
82 | { "DARK_TURQUOISE" , Color::hex(0x00CED1FF) }, |
83 | { "DARK_VIOLET" , Color::hex(0x9400D3FF) }, |
84 | { "DEEP_PINK" , Color::hex(0xFF1493FF) }, |
85 | { "DEEP_SKY_BLUE" , Color::hex(0x00BFFFFF) }, |
86 | { "DIM_GRAY" , Color::hex(0x696969FF) }, |
87 | { "DODGER_BLUE" , Color::hex(0x1E90FFFF) }, |
88 | { "FIREBRICK" , Color::hex(0xB22222FF) }, |
89 | { "FLORAL_WHITE" , Color::hex(0xFFFAF0FF) }, |
90 | { "FOREST_GREEN" , Color::hex(0x228B22FF) }, |
91 | { "FUCHSIA" , Color::hex(0xFF00FFFF) }, |
92 | { "GAINSBORO" , Color::hex(0xDCDCDCFF) }, |
93 | { "GHOST_WHITE" , Color::hex(0xF8F8FFFF) }, |
94 | { "GOLD" , Color::hex(0xFFD700FF) }, |
95 | { "GOLDENROD" , Color::hex(0xDAA520FF) }, |
96 | { "GRAY" , Color::hex(0xBEBEBEFF) }, |
97 | { "GREEN" , Color::hex(0x00FF00FF) }, |
98 | { "GREEN_YELLOW" , Color::hex(0xADFF2FFF) }, |
99 | { "HONEYDEW" , Color::hex(0xF0FFF0FF) }, |
100 | { "HOT_PINK" , Color::hex(0xFF69B4FF) }, |
101 | { "INDIAN_RED" , Color::hex(0xCD5C5CFF) }, |
102 | { "INDIGO" , Color::hex(0x4B0082FF) }, |
103 | { "IVORY" , Color::hex(0xFFFFF0FF) }, |
104 | { "KHAKI" , Color::hex(0xF0E68CFF) }, |
105 | { "LAVENDER" , Color::hex(0xE6E6FAFF) }, |
106 | { "LAVENDER_BLUSH" , Color::hex(0xFFF0F5FF) }, |
107 | { "LAWN_GREEN" , Color::hex(0x7CFC00FF) }, |
108 | { "LEMON_CHIFFON" , Color::hex(0xFFFACDFF) }, |
109 | { "LIGHT_BLUE" , Color::hex(0xADD8E6FF) }, |
110 | { "LIGHT_CORAL" , Color::hex(0xF08080FF) }, |
111 | { "LIGHT_CYAN" , Color::hex(0xE0FFFFFF) }, |
112 | { "LIGHT_GOLDENROD" , Color::hex(0xFAFAD2FF) }, |
113 | { "LIGHT_GRAY" , Color::hex(0xD3D3D3FF) }, |
114 | { "LIGHT_GREEN" , Color::hex(0x90EE90FF) }, |
115 | { "LIGHT_PINK" , Color::hex(0xFFB6C1FF) }, |
116 | { "LIGHT_SALMON" , Color::hex(0xFFA07AFF) }, |
117 | { "LIGHT_SEA_GREEN" , Color::hex(0x20B2AAFF) }, |
118 | { "LIGHT_SKY_BLUE" , Color::hex(0x87CEFAFF) }, |
119 | { "LIGHT_SLATE_GRAY" , Color::hex(0x778899FF) }, |
120 | { "LIGHT_STEEL_BLUE" , Color::hex(0xB0C4DEFF) }, |
121 | { "LIGHT_YELLOW" , Color::hex(0xFFFFE0FF) }, |
122 | { "LIME" , Color::hex(0x00FF00FF) }, |
123 | { "LIME_GREEN" , Color::hex(0x32CD32FF) }, |
124 | { "LINEN" , Color::hex(0xFAF0E6FF) }, |
125 | { "MAGENTA" , Color::hex(0xFF00FFFF) }, |
126 | { "MAROON" , Color::hex(0xB03060FF) }, |
127 | { "MEDIUM_AQUAMARINE" , Color::hex(0x66CDAAFF) }, |
128 | { "MEDIUM_BLUE" , Color::hex(0x0000CDFF) }, |
129 | { "MEDIUM_ORCHID" , Color::hex(0xBA55D3FF) }, |
130 | { "MEDIUM_PURPLE" , Color::hex(0x9370DBFF) }, |
131 | { "MEDIUM_SEA_GREEN" , Color::hex(0x3CB371FF) }, |
132 | { "MEDIUM_SLATE_BLUE" , Color::hex(0x7B68EEFF) }, |
133 | { "MEDIUM_SPRING_GREEN" , Color::hex(0x00FA9AFF) }, |
134 | { "MEDIUM_TURQUOISE" , Color::hex(0x48D1CCFF) }, |
135 | { "MEDIUM_VIOLET_RED" , Color::hex(0xC71585FF) }, |
136 | { "MIDNIGHT_BLUE" , Color::hex(0x191970FF) }, |
137 | { "MINT_CREAM" , Color::hex(0xF5FFFAFF) }, |
138 | { "MISTY_ROSE" , Color::hex(0xFFE4E1FF) }, |
139 | { "MOCCASIN" , Color::hex(0xFFE4B5FF) }, |
140 | { "NAVAJO_WHITE" , Color::hex(0xFFDEADFF) }, |
141 | { "NAVY_BLUE" , Color::hex(0x000080FF) }, |
142 | { "OLD_LACE" , Color::hex(0xFDF5E6FF) }, |
143 | { "OLIVE" , Color::hex(0x808000FF) }, |
144 | { "OLIVE_DRAB" , Color::hex(0x6B8E23FF) }, |
145 | { "ORANGE" , Color::hex(0xFFA500FF) }, |
146 | { "ORANGE_RED" , Color::hex(0xFF4500FF) }, |
147 | { "ORCHID" , Color::hex(0xDA70D6FF) }, |
148 | { "PALE_GOLDENROD" , Color::hex(0xEEE8AAFF) }, |
149 | { "PALE_GREEN" , Color::hex(0x98FB98FF) }, |
150 | { "PALE_TURQUOISE" , Color::hex(0xAFEEEEFF) }, |
151 | { "PALE_VIOLET_RED" , Color::hex(0xDB7093FF) }, |
152 | { "PAPAYA_WHIP" , Color::hex(0xFFEFD5FF) }, |
153 | { "PEACH_PUFF" , Color::hex(0xFFDAB9FF) }, |
154 | { "PERU" , Color::hex(0xCD853FFF) }, |
155 | { "PINK" , Color::hex(0xFFC0CBFF) }, |
156 | { "PLUM" , Color::hex(0xDDA0DDFF) }, |
157 | { "POWDER_BLUE" , Color::hex(0xB0E0E6FF) }, |
158 | { "PURPLE" , Color::hex(0xA020F0FF) }, |
159 | { "REBECCA_PURPLE" , Color::hex(0x663399FF) }, |
160 | { "RED" , Color::hex(0xFF0000FF) }, |
161 | { "ROSY_BROWN" , Color::hex(0xBC8F8FFF) }, |
162 | { "ROYAL_BLUE" , Color::hex(0x4169E1FF) }, |
163 | { "SADDLE_BROWN" , Color::hex(0x8B4513FF) }, |
164 | { "SALMON" , Color::hex(0xFA8072FF) }, |
165 | { "SANDY_BROWN" , Color::hex(0xF4A460FF) }, |
166 | { "SEA_GREEN" , Color::hex(0x2E8B57FF) }, |
167 | { "SEASHELL" , Color::hex(0xFFF5EEFF) }, |
168 | { "SIENNA" , Color::hex(0xA0522DFF) }, |
169 | { "SILVER" , Color::hex(0xC0C0C0FF) }, |
170 | { "SKY_BLUE" , Color::hex(0x87CEEBFF) }, |
171 | { "SLATE_BLUE" , Color::hex(0x6A5ACDFF) }, |
172 | { "SLATE_GRAY" , Color::hex(0x708090FF) }, |
173 | { "SNOW" , Color::hex(0xFFFAFAFF) }, |
174 | { "SPRING_GREEN" , Color::hex(0x00FF7FFF) }, |
175 | { "STEEL_BLUE" , Color::hex(0x4682B4FF) }, |
176 | { "TAN" , Color::hex(0xD2B48CFF) }, |
177 | { "TEAL" , Color::hex(0x008080FF) }, |
178 | { "THISTLE" , Color::hex(0xD8BFD8FF) }, |
179 | { "TOMATO" , Color::hex(0xFF6347FF) }, |
180 | { "TRANSPARENT" , Color::hex(0xFFFFFF00) }, |
181 | { "TURQUOISE" , Color::hex(0x40E0D0FF) }, |
182 | { "VIOLET" , Color::hex(0xEE82EEFF) }, |
183 | { "WEB_GRAY" , Color::hex(0x808080FF) }, |
184 | { "WEB_GREEN" , Color::hex(0x008000FF) }, |
185 | { "WEB_MAROON" , Color::hex(0x800000FF) }, |
186 | { "WEB_PURPLE" , Color::hex(0x800080FF) }, |
187 | { "WHEAT" , Color::hex(0xF5DEB3FF) }, |
188 | { "WHITE" , Color::hex(0xFFFFFFFF) }, |
189 | { "WHITE_SMOKE" , Color::hex(0xF5F5F5FF) }, |
190 | { "YELLOW" , Color::hex(0xFFFF00FF) }, |
191 | { "YELLOW_GREEN" , Color::hex(0x9ACD32FF) }, |
192 | { nullptr, Color() }, |
193 | }; |
194 | |