Merge remote-tracking branch 'net/master'

This commit is contained in:
Maxime Coste 2017-10-25 11:13:42 +08:00
commit ab9283bc37
4 changed files with 34 additions and 9 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: `bright-black, bright-red, bright-green, bright-yellow, bright-blue, bright-magenta, bright-cyan, bright-white`.
* `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",
"bright-black",
"bright-red",
"bright-green",
"bright-yellow",
"bright-blue",
"bright-magenta",
"bright-cyan",
"bright-white",
};
bool is_color_name(StringView color)

View File

@ -22,6 +22,14 @@ struct Color
Magenta,
Cyan,
White,
BrightBlack,
BrightRed,
BrightGreen,
BrightYellow,
BrightBlue,
BrightMagenta,
BrightCyan,
BrightWhite,
RGB,
};

View File

@ -229,15 +229,23 @@ void on_term_resize(int)
static const std::initializer_list<HashMap<Kakoune::Color, int>::Item>
default_colors = {
{ Color::Default, -1 },
{ Color::Black, COLOR_BLACK },
{ Color::Red, COLOR_RED },
{ Color::Green, COLOR_GREEN },
{ Color::Yellow, COLOR_YELLOW },
{ Color::Blue, COLOR_BLUE },
{ Color::Magenta, COLOR_MAGENTA },
{ Color::Cyan, COLOR_CYAN },
{ Color::White, COLOR_WHITE },
{ Color::Default, -1 },
{ Color::Black, 0 },
{ Color::Red, 1 },
{ Color::Green, 2 },
{ Color::Yellow, 3 },
{ Color::Blue, 4 },
{ Color::Magenta, 5 },
{ Color::Cyan, 6 },
{ Color::White, 7 },
{ Color::BrightBlack, 8 },
{ Color::BrightRed, 9 },
{ Color::BrightGreen, 10 },
{ Color::BrightYellow, 11 },
{ Color::BrightBlue, 12 },
{ Color::BrightMagenta, 13 },
{ Color::BrightCyan, 14 },
{ Color::BrightWhite, 15 },
};
NCursesUI::NCursesUI()