forked from KolibriOS/kolibrios
aec194c6f0
git-svn-id: svn://kolibrios.org@2238 a494cfbc-eb01-0410-851d-a64ba20cac60
327 lines
4.2 KiB
Plaintext
327 lines
4.2 KiB
Plaintext
//Íàäî áóäåò ïåðåäåëàòü íà "äåðåâî ïîèñêà" èëè, ÷òî-òî ïîäîáíîå
|
|
//áóäåò íå÷èòàáåëüíî, çàòî ìåíüøå è áûñòåå
|
|
|
|
//Èìåíà web öâåòîâ
|
|
char *color_names[]={
|
|
"aliceblue",
|
|
"antiquewhite",
|
|
"aqua",
|
|
"aquamarine",
|
|
"azure",
|
|
"beige",
|
|
"bisque",
|
|
"black",
|
|
"blanchedalmond",
|
|
"blue",
|
|
"blueviolet",
|
|
"brown",
|
|
"burlywood",
|
|
"cadetblue",
|
|
"chartreuse",
|
|
"chocolate",
|
|
"coral",
|
|
"cornflowerblue",
|
|
"cornsilk",
|
|
"crimson",
|
|
"cyan",
|
|
"darkblue",
|
|
"darkcyan",
|
|
"darkgoldenrod",
|
|
"darkgray",
|
|
"darkgreen",
|
|
"darkkhaki",
|
|
"darkmagenta",
|
|
"darkolivegreen",
|
|
"darkorange",
|
|
"darkorchid",
|
|
"darkred",
|
|
"darksalmon",
|
|
"darkseagreen",
|
|
"darkslateblue",
|
|
"darkslategray",
|
|
"darkturquoise",
|
|
"darkviolet",
|
|
"deeppink",
|
|
"deepskyblue",
|
|
"dimgray",
|
|
"dodgerblue",
|
|
"firebrick",
|
|
"floralwhite",
|
|
"forestgreen",
|
|
"fuchsia",
|
|
"gainsboro",
|
|
"ghostwhite",
|
|
"gold",
|
|
"goldenrod",
|
|
"gray",
|
|
"green",
|
|
"greenyellow",
|
|
"honeydew",
|
|
"hotpink",
|
|
"indianred",
|
|
"indigo",
|
|
"ivory",
|
|
"khaki",
|
|
"lavender",
|
|
"lavenderblush",
|
|
"lawngreen",
|
|
"lemonchiffon",
|
|
"lightblue",
|
|
"lightcoral",
|
|
"lightcyan",
|
|
"lightgoldenrodyellow",
|
|
"lightgray",
|
|
"lightgreen",
|
|
"lightpink",
|
|
"lightsalmon",
|
|
"lightseagreen",
|
|
"lightskyblue",
|
|
"lightslategray",
|
|
"lightsteelblue",
|
|
"lightyellow",
|
|
"lime",
|
|
"limegreen",
|
|
"linen",
|
|
"magenta",
|
|
"maroon",
|
|
"mediumaquamarine",
|
|
"mediumblue",
|
|
"mediumorchid",
|
|
"mediumpurple",
|
|
"mediumseagreen",
|
|
"mediumslateblue",
|
|
"mediumspringgreen",
|
|
"mediumturquoise",
|
|
"mediumvioletred",
|
|
"midnightblue",
|
|
"mintcream",
|
|
"mistyrose",
|
|
"moccasin",
|
|
"navajowhite",
|
|
"navy",
|
|
"navyblue",
|
|
"oldlace",
|
|
"olive",
|
|
"olivedrab",
|
|
"orange",
|
|
"orangered",
|
|
"orchid",
|
|
"palegoldenrod",
|
|
"paleturquoise",
|
|
"palevioletred",
|
|
"papayawhip",
|
|
"peachpuff",
|
|
"peru",
|
|
"pink",
|
|
"plum",
|
|
"powderblue",
|
|
"purple",
|
|
"red",
|
|
"rosybrown",
|
|
"royalblue",
|
|
"saddlebrown",
|
|
"salmon",
|
|
"sandybrown",
|
|
"seagreen",
|
|
"seashell",
|
|
"sienna",
|
|
"silver",
|
|
"skyblue",
|
|
"slateblue",
|
|
"slategray",
|
|
"snow",
|
|
"springgreen",
|
|
"steelblue",
|
|
"tan",
|
|
"teal",
|
|
"thistle",
|
|
"tomato",
|
|
"turquoise",
|
|
"violet",
|
|
"wheat",
|
|
"white",
|
|
"whitesmoke",
|
|
"yellow",
|
|
"yellowgreen",
|
|
0};
|
|
|
|
//ñîîòâåòñòâóþùèå èì çíà÷åíèÿ
|
|
dword *colors[]={
|
|
0xf0f8ff,
|
|
0xfaebd7,
|
|
0x00ffff,
|
|
0x7fffd4,
|
|
0xf0ffff,
|
|
0xf5f5dc,
|
|
0xffe4c4,
|
|
0x000000,
|
|
0xffebcd,
|
|
0x0000ff,
|
|
0x8a2be2,
|
|
0xa52a2a,
|
|
0xdeb887,
|
|
0x5f9ea0,
|
|
0x7fff00,
|
|
0xd2691e,
|
|
0xff7f50,
|
|
0x6495ed,
|
|
0xfff8dc,
|
|
0xdc143c,
|
|
0x00ffff,
|
|
0x00008b,
|
|
0x008b8b,
|
|
0xb8860b,
|
|
0xa9a9a9,
|
|
0x006400,
|
|
0xbdb76b,
|
|
0x8b008b,
|
|
0x556b2f,
|
|
0xff8c00,
|
|
0x9932cc,
|
|
0x8b0000,
|
|
0xe9967a,
|
|
0x8fbc8f,
|
|
0x483d8b,
|
|
0x2f4f4f,
|
|
0x00ced1,
|
|
0x9400d3,
|
|
0xff1493,
|
|
0x00bfff,
|
|
0x696969,
|
|
0x1e90ff,
|
|
0xb22222,
|
|
0xfffaf0,
|
|
0x228b22,
|
|
0xff00ff,
|
|
0xdcdcdc,
|
|
0xf8f8ff,
|
|
0xffd700,
|
|
0xdaa520,
|
|
0x808080,
|
|
0x008000,
|
|
0xadff2f,
|
|
0xf0fff0,
|
|
0xff69b4,
|
|
0xcd5c5c,
|
|
0x4b0082,
|
|
0xfffff0,
|
|
0xf0e68c,
|
|
0xe6e6fa,
|
|
0xfff0f5,
|
|
0x7cfc00,
|
|
0xfffacd,
|
|
0xadd8e6,
|
|
0xf08080,
|
|
0xe0ffff,
|
|
0xfafad2,
|
|
0xd3d3d3,
|
|
0x90ee90,
|
|
0xffb6c1,
|
|
0xffa07a,
|
|
0x20b2aa,
|
|
0x87cefa,
|
|
0x778899,
|
|
0xb0c4de,
|
|
0xffffe0,
|
|
0x00ff00,
|
|
0x32cd32,
|
|
0xfaf0e6,
|
|
0xff00ff,
|
|
0x800000,
|
|
0x66cdaa,
|
|
0x0000cd,
|
|
0xba55d3,
|
|
0x9370db,
|
|
0x3cb371,
|
|
0x7b68ee,
|
|
0x00fa9a,
|
|
0x48d1cc,
|
|
0xc71585,
|
|
0x191970,
|
|
0xf5fffa,
|
|
0xffe4e1,
|
|
0xffe4b5,
|
|
0xffdead,
|
|
0x000080,
|
|
0x9fafdf,
|
|
0xfdf5e6,
|
|
0x808000,
|
|
0x6b8e23,
|
|
0xffa500,
|
|
0xff4500,
|
|
0xda70d6,
|
|
0xeee8aa,
|
|
0xafeeee,
|
|
0xd87093,
|
|
0xffefd5,
|
|
0xffdab9,
|
|
0xcd853f,
|
|
0xffc0cb,
|
|
0xdda0dd,
|
|
0xb0e0e6,
|
|
0x800080,
|
|
0xff0000,
|
|
0xbc8f8f,
|
|
0x4169e1,
|
|
0x8b4513,
|
|
0xfa8072,
|
|
0xf4a460,
|
|
0x2e8b57,
|
|
0xfff5ee,
|
|
0xa0522d,
|
|
0xc0c0c0,
|
|
0x87ceeb,
|
|
0x6a5acd,
|
|
0x708090,
|
|
0xfffafa,
|
|
0x00ff7f,
|
|
0x4682b4,
|
|
0xd2b48c,
|
|
0x008080,
|
|
0xd8bfd8,
|
|
0xff6347,
|
|
0x40e0d0,
|
|
0xee82ee,
|
|
0xf5deb3,
|
|
0xffffff,
|
|
0xf5f5f5,
|
|
0xffff00,
|
|
0x9acd32};
|
|
|
|
dword StrToCol(char* htmlcolor)
|
|
{
|
|
dword j=1, color=0;
|
|
char ch=0x00;
|
|
|
|
IF (ESBYTE[htmlcolor]<>'#') RETURN;
|
|
|
|
FOR (;j<7;j++)
|
|
{
|
|
ch=ESBYTE[htmlcolor+j];
|
|
IF ((ch>='0') && (ch<='9')) ch -= '0';
|
|
IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
|
|
IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
|
|
color = color*0x10 + ch;
|
|
}
|
|
|
|
return color;
|
|
}
|
|
|
|
dword GetColor(char* color_str)
|
|
{
|
|
int ii;
|
|
|
|
IF (ESBYTE[color_str] == '#')
|
|
return StrToCol(color_str);
|
|
|
|
ELSE
|
|
FOR (ii=0; color_names[ii]!=0; ii++)
|
|
{
|
|
IF(!strcmp(color_str, color_names[ii]))
|
|
{
|
|
return colors[ii];
|
|
}
|
|
}
|
|
return text_colors[0];
|
|
}
|