aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/color.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2015-11-24 12:36:35 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-12-08 20:08:08 -0800
commit0a0acc8a2e0b8c2ca0c0500123d586d629f99b16 (patch)
tree6c388b7969c1ff464d3a34abb66469bc581e0baf /src/color.cpp
parentef67fc7ba05ab2c9b8e6b5240ce4f9da92ca79b8 (diff)
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.
Diffstat (limited to 'src/color.cpp')
-rw-r--r--src/color.cpp16
1 files changed, 13 insertions, 3 deletions
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)