Subversion Repositories Kolibri OS

Rev

Rev 2152 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2152 Rev 2238
Line 285... Line 285...
285
0xf5deb3,
285
0xf5deb3,
286
0xffffff,
286
0xffffff,
287
0xf5f5f5,
287
0xf5f5f5,
288
0xffff00,
288
0xffff00,
289
0x9acd32};
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
		{
-
 
320
			IF(!strcmp(color_str, color_names[ii]))
-
 
321
			{
-
 
322
				return colors[ii];
-
 
323
			}
-
 
324
		}
-
 
325
	return text_colors[0];
-
 
326
}