Rev 2413 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2413 | leency | 1 | //Надо будет переделать на "дерево поиска" или, что-то подобное |
2 | //будет нечитабельно, зато меньше и быстее |
||
3 | |||
4 | //Имена web цветов |
||
5 | char *color_names[]={ |
||
6 | "aliceblue", |
||
7 | "antiquewhite", |
||
8 | "aqua", |
||
9 | "aquamarine", |
||
10 | "azure", |
||
11 | "beige", |
||
12 | "bisque", |
||
13 | "black", |
||
14 | "blanchedalmond", |
||
15 | "blue", |
||
16 | "blueviolet", |
||
17 | "brown", |
||
18 | "burlywood", |
||
19 | "cadetblue", |
||
20 | "chartreuse", |
||
21 | "chocolate", |
||
22 | "coral", |
||
23 | "cornflowerblue", |
||
24 | "cornsilk", |
||
25 | "crimson", |
||
26 | "cyan", |
||
27 | "darkblue", |
||
28 | "darkcyan", |
||
29 | "darkgoldenrod", |
||
30 | "darkgray", |
||
31 | "darkgreen", |
||
32 | "darkkhaki", |
||
33 | "darkmagenta", |
||
34 | "darkolivegreen", |
||
35 | "darkorange", |
||
36 | "darkorchid", |
||
37 | "darkred", |
||
38 | "darksalmon", |
||
39 | "darkseagreen", |
||
40 | "darkslateblue", |
||
41 | "darkslategray", |
||
42 | "darkturquoise", |
||
43 | "darkviolet", |
||
44 | "deeppink", |
||
45 | "deepskyblue", |
||
46 | "dimgray", |
||
47 | "dodgerblue", |
||
48 | "firebrick", |
||
49 | "floralwhite", |
||
50 | "forestgreen", |
||
51 | "fuchsia", |
||
52 | "gainsboro", |
||
53 | "ghostwhite", |
||
54 | "gold", |
||
55 | "goldenrod", |
||
56 | "gray", |
||
57 | "green", |
||
58 | "greenyellow", |
||
59 | "honeydew", |
||
60 | "hotpink", |
||
61 | "indianred", |
||
62 | "indigo", |
||
63 | "ivory", |
||
64 | "khaki", |
||
65 | "lavender", |
||
66 | "lavenderblush", |
||
67 | "lawngreen", |
||
68 | "lemonchiffon", |
||
69 | "lightblue", |
||
70 | "lightcoral", |
||
71 | "lightcyan", |
||
72 | "lightgoldenrodyellow", |
||
73 | "lightgray", |
||
74 | "lightgreen", |
||
75 | "lightpink", |
||
76 | "lightsalmon", |
||
77 | "lightseagreen", |
||
78 | "lightskyblue", |
||
79 | "lightslategray", |
||
80 | "lightsteelblue", |
||
81 | "lightyellow", |
||
82 | "lime", |
||
83 | "limegreen", |
||
84 | "linen", |
||
85 | "magenta", |
||
86 | "maroon", |
||
87 | "mediumaquamarine", |
||
88 | "mediumblue", |
||
89 | "mediumorchid", |
||
90 | "mediumpurple", |
||
91 | "mediumseagreen", |
||
92 | "mediumslateblue", |
||
93 | "mediumspringgreen", |
||
94 | "mediumturquoise", |
||
95 | "mediumvioletred", |
||
96 | "midnightblue", |
||
97 | "mintcream", |
||
98 | "mistyrose", |
||
99 | "moccasin", |
||
100 | "navajowhite", |
||
101 | "navy", |
||
102 | "navyblue", |
||
103 | "oldlace", |
||
104 | "olive", |
||
105 | "olivedrab", |
||
106 | "orange", |
||
107 | "orangered", |
||
108 | "orchid", |
||
109 | "palegoldenrod", |
||
110 | "paleturquoise", |
||
111 | "palevioletred", |
||
112 | "papayawhip", |
||
113 | "peachpuff", |
||
114 | "peru", |
||
115 | "pink", |
||
116 | "plum", |
||
117 | "powderblue", |
||
118 | "purple", |
||
119 | "red", |
||
120 | "rosybrown", |
||
121 | "royalblue", |
||
122 | "saddlebrown", |
||
123 | "salmon", |
||
124 | "sandybrown", |
||
125 | "seagreen", |
||
126 | "seashell", |
||
127 | "sienna", |
||
128 | "silver", |
||
129 | "skyblue", |
||
130 | "slateblue", |
||
131 | "slategray", |
||
132 | "snow", |
||
133 | "springgreen", |
||
134 | "steelblue", |
||
135 | "tan", |
||
136 | "teal", |
||
137 | "thistle", |
||
138 | "tomato", |
||
139 | "turquoise", |
||
140 | "violet", |
||
141 | "wheat", |
||
142 | "white", |
||
143 | "whitesmoke", |
||
144 | "yellow", |
||
145 | "yellowgreen", |
||
146 | 0}; |
||
147 | |||
148 | //соответствующие им значения |
||
149 | dword *colors[]={ |
||
150 | 0xf0f8ff, |
||
151 | 0xfaebd7, |
||
152 | 0x00ffff, |
||
153 | 0x7fffd4, |
||
154 | 0xf0ffff, |
||
155 | 0xf5f5dc, |
||
156 | 0xffe4c4, |
||
157 | 0x000000, |
||
158 | 0xffebcd, |
||
159 | 0x0000ff, |
||
160 | 0x8a2be2, |
||
161 | 0xa52a2a, |
||
162 | 0xdeb887, |
||
163 | 0x5f9ea0, |
||
164 | 0x7fff00, |
||
165 | 0xd2691e, |
||
166 | 0xff7f50, |
||
167 | 0x6495ed, |
||
168 | 0xfff8dc, |
||
169 | 0xdc143c, |
||
170 | 0x00ffff, |
||
171 | 0x00008b, |
||
172 | 0x008b8b, |
||
173 | 0xb8860b, |
||
174 | 0xa9a9a9, |
||
175 | 0x006400, |
||
176 | 0xbdb76b, |
||
177 | 0x8b008b, |
||
178 | 0x556b2f, |
||
179 | 0xff8c00, |
||
180 | 0x9932cc, |
||
181 | 0x8b0000, |
||
182 | 0xe9967a, |
||
183 | 0x8fbc8f, |
||
184 | 0x483d8b, |
||
185 | 0x2f4f4f, |
||
186 | 0x00ced1, |
||
187 | 0x9400d3, |
||
188 | 0xff1493, |
||
189 | 0x00bfff, |
||
190 | 0x696969, |
||
191 | 0x1e90ff, |
||
192 | 0xb22222, |
||
193 | 0xfffaf0, |
||
194 | 0x228b22, |
||
195 | 0xff00ff, |
||
196 | 0xdcdcdc, |
||
197 | 0xf8f8ff, |
||
198 | 0xffd700, |
||
199 | 0xdaa520, |
||
200 | 0x808080, |
||
201 | 0x008000, |
||
202 | 0xadff2f, |
||
203 | 0xf0fff0, |
||
204 | 0xff69b4, |
||
205 | 0xcd5c5c, |
||
206 | 0x4b0082, |
||
207 | 0xfffff0, |
||
208 | 0xf0e68c, |
||
209 | 0xe6e6fa, |
||
210 | 0xfff0f5, |
||
211 | 0x7cfc00, |
||
212 | 0xfffacd, |
||
213 | 0xadd8e6, |
||
214 | 0xf08080, |
||
215 | 0xe0ffff, |
||
216 | 0xfafad2, |
||
217 | 0xd3d3d3, |
||
218 | 0x90ee90, |
||
219 | 0xffb6c1, |
||
220 | 0xffa07a, |
||
221 | 0x20b2aa, |
||
222 | 0x87cefa, |
||
223 | 0x778899, |
||
224 | 0xb0c4de, |
||
225 | 0xffffe0, |
||
226 | 0x00ff00, |
||
227 | 0x32cd32, |
||
228 | 0xfaf0e6, |
||
229 | 0xff00ff, |
||
230 | 0x800000, |
||
231 | 0x66cdaa, |
||
232 | 0x0000cd, |
||
233 | 0xba55d3, |
||
234 | 0x9370db, |
||
235 | 0x3cb371, |
||
236 | 0x7b68ee, |
||
237 | 0x00fa9a, |
||
238 | 0x48d1cc, |
||
239 | 0xc71585, |
||
240 | 0x191970, |
||
241 | 0xf5fffa, |
||
242 | 0xffe4e1, |
||
243 | 0xffe4b5, |
||
244 | 0xffdead, |
||
245 | 0x000080, |
||
246 | 0x9fafdf, |
||
247 | 0xfdf5e6, |
||
248 | 0x808000, |
||
249 | 0x6b8e23, |
||
250 | 0xffa500, |
||
251 | 0xff4500, |
||
252 | 0xda70d6, |
||
253 | 0xeee8aa, |
||
254 | 0xafeeee, |
||
255 | 0xd87093, |
||
256 | 0xffefd5, |
||
257 | 0xffdab9, |
||
258 | 0xcd853f, |
||
259 | 0xffc0cb, |
||
260 | 0xdda0dd, |
||
261 | 0xb0e0e6, |
||
262 | 0x800080, |
||
263 | 0xff0000, |
||
264 | 0xbc8f8f, |
||
265 | 0x4169e1, |
||
266 | 0x8b4513, |
||
267 | 0xfa8072, |
||
268 | 0xf4a460, |
||
269 | 0x2e8b57, |
||
270 | 0xfff5ee, |
||
271 | 0xa0522d, |
||
272 | 0xc0c0c0, |
||
273 | 0x87ceeb, |
||
274 | 0x6a5acd, |
||
275 | 0x708090, |
||
276 | 0xfffafa, |
||
277 | 0x00ff7f, |
||
278 | 0x4682b4, |
||
279 | 0xd2b48c, |
||
280 | 0x008080, |
||
281 | 0xd8bfd8, |
||
282 | 0xff6347, |
||
283 | 0x40e0d0, |
||
284 | 0xee82ee, |
||
285 | 0xf5deb3, |
||
286 | 0xffffff, |
||
287 | 0xf5f5f5, |
||
288 | 0xffff00, |
||
289 | 0x9acd32}; |
||
290 | |||
291 | dword StrToCol(char* htmlcolor) |
||
292 | { |
||
293 | dword j=1, color=0; |
||
294 | char ch=0x00; |
||
295 | |||
296 | IF (ESBYTE[htmlcolor]<>'#') RETURN; |
||
297 | |||
298 | FOR (;j<7;j++) |
||
299 | { |
||
300 | ch=ESBYTE[htmlcolor+j]; |
||
301 | IF ((ch>='0') && (ch<='9')) ch -= '0'; |
||
302 | IF ((ch>='A') && (ch<='F')) ch -= 'A'-10; |
||
303 | IF ((ch>='a') && (ch<='f')) ch -= 'a'-10; |
||
304 | color = color*0x10 + ch; |
||
305 | } |
||
306 | |||
307 | return color; |
||
308 | } |
||
309 | |||
310 | dword GetColor(char* color_str) |
||
311 | { |
||
312 | int ii; |
||
313 | |||
314 | IF (ESBYTE[color_str] == '#') |
||
315 | return StrToCol(color_str); |
||
316 | |||
317 | ELSE |
||
318 | FOR (ii=0; color_names[ii]!=0; ii++) |
||
319 | { |
||
2839 | leency | 320 | IF(!strcmp(color_str, color_names[ii])) return colors[ii]; |
2413 | leency | 321 | } |
322 | return text_colors[0]; |
||
323 | }='f'))>='F'))>='9'))>7;j++) |