Support bright named colors

This commit is contained in:
Net 2017-10-22 14:30:49 -04:00
parent 6740e3cc0c
commit 2b44e93f79
4 changed files with 25 additions and 0 deletions

View File

@ -1046,6 +1046,7 @@ fg_color[,bg_color][+attributes]
fg_color and bg_color can be:
* A named color: `black, red, green, yellow, blue, magenta, cyan, white`.
* A named bright color: `brblack, brred, brgreen, bryellow, brblue, brmagenta, brcyan, brwhite`.
* `default`, which keeps the existing color
* An rgb color: `rgb:RRGGBB`, with RRGGBB the hexadecimal value of the color.

View File

@ -19,6 +19,14 @@ static constexpr const char* color_names[] = {
"magenta",
"cyan",
"white",
"brblack",
"brred",
"brgreen",
"bryellow",
"brblue",
"brmagenta",
"brcyan",
"brwhite",
};
bool is_color_name(StringView color)

View File

@ -22,6 +22,14 @@ struct Color
Magenta,
Cyan,
White,
BrBlack,
BrRed,
BrGreen,
BrYellow,
BrBlue,
BrMagenta,
BrCyan,
BrWhite,
RGB,
};

View File

@ -238,6 +238,14 @@ default_colors = {
{ Color::Magenta, COLOR_MAGENTA },
{ Color::Cyan, COLOR_CYAN },
{ Color::White, COLOR_WHITE },
{ Color::BrBlack, 8 },
{ Color::BrRed, 9 },
{ Color::BrGreen, 10 },
{ Color::BrYellow, 11 },
{ Color::BrBlue, 12 },
{ Color::BrMagenta, 13 },
{ Color::BrCyan, 14 },
{ Color::BrWhite, 15 },
};
NCursesUI::NCursesUI()