From 0a0acc8a2e0b8c2ca0c0500123d586d629f99b16 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 24 Nov 2015 12:36:35 -0800 Subject: add support for ANSI "bright" colors This adds support for the ANSI x3.64 "bright" colors in the basic sixteen color palette. This is especially useful when trying to use the base colors as a background color. The "bright" variants tend to be more useful as background colors compared to the non-bright variants. This also fixes a bug in so far as palette number 7 is actually grey and not white whereas palette number 15 is white. At least on the terminal emulators on which I've tested this change (Ubuntu xterm & uxterm, Mac OS X Terminal & iTerm2). Resolves issue #1464. --- src/color.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/color.cpp') diff --git a/src/color.cpp b/src/color.cpp index d076ea17..e19fb994 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -160,7 +160,7 @@ struct named_color_t unsigned char rgb[3]; }; -static const named_color_t named_colors[11] = +static const named_color_t named_colors[] = { {L"black", 0, {0, 0, 0}}, {L"red", 1, {0xFF, 0, 0}}, @@ -171,8 +171,18 @@ static const named_color_t named_colors[11] = {L"magenta", 5, {0xFF, 0, 0xFF}}, {L"purple", 5, {0xFF, 0, 0xFF}}, {L"cyan", 6, {0, 0xFF, 0xFF}}, - {L"white", 7, {0xFF, 0xFF, 0xFF}}, - {L"normal", 8, {0xFF, 0xFF, 0XFF}} + {L"grey", 7, {0xE5, 0xE5, 0xE5}}, + {L"normal", 7, {0xE5, 0xE5, 0XE5}}, + {L"brgrey", 8, {0x55, 0x55, 0x55}}, + {L"brred", 9, {0xFF, 0x55, 0x55}}, + {L"brgreen", 10, {0x55, 0xFF, 0x55}}, + {L"brbrown", 11, {0xFF, 0xFF, 0x55}}, + {L"bryellow", 11, {0xFF, 0xFF, 0x55}}, + {L"brblue", 12, {0x55, 0x55, 0xFF}}, + {L"brmagenta", 13, {0xFF, 0x55, 0xFF}}, + {L"brpurple", 13, {0xFF, 0x55, 0xFF}}, + {L"brcyan", 14, {0x55, 0xFF, 0xFF}}, + {L"white", 15, {0xFF, 0xFF, 0xFF}}, }; wcstring_list_t rgb_color_t::named_color_names(void) -- cgit v1.2.3