comparison mcabber/src/screen.c @ 1417:783b47c9d963

Allow more than the 16 default colors (patch from mjs) If the terminal supports more than 16 colors (e.g. xterm-256color), the color numbers can be set in place of the color names.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Jan 2008 22:46:16 +0100
parents 366ef500c522
children 757ebe4df0b9
comparison
equal deleted inserted replaced
1416:7f0da8de2a7d 1417:783b47c9d963
242 242
243 static int FindColor(const char *name) 243 static int FindColor(const char *name)
244 { 244 {
245 int result = FindColorInternal(name); 245 int result = FindColorInternal(name);
246 if (result != -2) 246 if (result != -2)
247 return result;
248
249 // Directly support 256-color values
250 result = atoi(name);
251 if (result > 0 && result < COLORS)
247 return result; 252 return result;
248 253
249 scr_LogPrint(LPRINT_LOGNORM, "ERROR: Wrong color: %s", name); 254 scr_LogPrint(LPRINT_LOGNORM, "ERROR: Wrong color: %s", name);
250 return -1; 255 return -1;
251 } 256 }