1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 18:23:13 +02:00

core: add decoding of bright ANSI colors (90-97, 100-107)

This commit is contained in:
Sebastien Helleu
2014-03-15 12:09:31 +01:00
parent 298f0211c1
commit 6749ed354d
+32 -2
View File
@@ -102,8 +102,14 @@ int gui_color_term256[256] =
/* ANSI colors */
regex_t *gui_color_regex_ansi = NULL;
char *gui_color_ansi[8] =
{ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" };
char *gui_color_ansi[16] =
{
/* 0-7 */
"black", "red", "green", "brown", "blue", "magenta", "cyan", "gray",
/* 8-15 */
"darkgray", "lightred", "lightgreen", "yellow", "lightblue", "lightmagenta",
"lightcyan", "white",
};
/*
@@ -876,6 +882,30 @@ gui_color_decode_ansi_cb (void *data, const char *text)
case 49: /* default background color */
strcat (output, gui_color_get_custom (",default"));
break;
case 90: /* text color (bright) */
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
strcat (output,
gui_color_get_custom (gui_color_ansi[value - 90 + 8]));
break;
case 100: /* background color (bright) */
case 101:
case 102:
case 103:
case 104:
case 105:
case 106:
case 107:
snprintf (str_color, sizeof (str_color),
"|,%s",
gui_color_ansi[value - 100 + 8]);
strcat (output, gui_color_get_custom (str_color));
break;
}
}