# HG changeset patch # User Mikael Berthe # Date 1200865576 -3600 # Node ID 783b47c9d963a6541f2cbfd617a41cff1ca8dc50 # Parent 7f0da8de2a7d38f982695e9ff716a2d5a6b91512 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. diff -r 7f0da8de2a7d -r 783b47c9d963 mcabber/mcabberrc.example --- a/mcabber/mcabberrc.example Sat Jan 19 16:52:45 2008 +0100 +++ b/mcabber/mcabberrc.example Sun Jan 20 22:46:16 2008 +0100 @@ -286,9 +286,11 @@ # Colors are: black, red, green, yellow, blue, magenta, cyan, white # For text colors (i.e. not background and bg* colors) you can also use # the "bright" prefix to get a bright/bold color. Example: brightblue -# You can use the "default" color, too (i.e. for transparent background) +# You can use the "default" color, too (i.e. for transparent background). +# If your terminal supports 256 colors, you can use the color number +# directly (16-255). # -# You can have a look at the contrib/themes/ directory to see some sample +# Have a look at the contrib/themes/ directory to see some sample # color settings. # # background: background color of the chat window and the log window diff -r 7f0da8de2a7d -r 783b47c9d963 mcabber/src/screen.c --- a/mcabber/src/screen.c Sat Jan 19 16:52:45 2008 +0100 +++ b/mcabber/src/screen.c Sun Jan 20 22:46:16 2008 +0100 @@ -246,6 +246,11 @@ if (result != -2) return result; + // Directly support 256-color values + result = atoi(name); + if (result > 0 && result < COLORS) + return result; + scr_LogPrint(LPRINT_LOGNORM, "ERROR: Wrong color: %s", name); return -1; }