From f08effc46de52655c8431498c6bc214c0eda30e5 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 17 May 2020 18:19:57 -0400 Subject: Introduce style strings to replace color options https://git-scm.com/docs/git-config#Documentation/git-config.txt-color - Support "syntax" pseudo foreground color - Delete the --syntax-highlight CLI option This was never released. --- src/style.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/style.rs') diff --git a/src/style.rs b/src/style.rs index 80256805..339e3f02 100644 --- a/src/style.rs +++ b/src/style.rs @@ -170,6 +170,18 @@ const DARK_THEME_PLUS_EMPH_COLOR_256: Color = Color { /// A special color to specify that no color escape codes should be emitted. pub const NO_COLOR: Color = Color::BLACK; +/// A special color value to signify that the foreground color of a style should be derived from +/// syntax highlighting. +// alpha is 0, which is how the 256-palette colors are encoded (see bat::terminal::to_ansi_color). +// So if painted, this would be black. However, the presence of a non-zero bit in the blue channel +// distinguishes this from any 256-palette color. +pub const SYNTAX_HIGHLIGHTING_COLOR: Color = Color { + r: 0x00, + g: 0x00, + b: 0x01, + a: 0x00, +}; + pub fn get_no_style() -> Style { Style { foreground: NO_COLOR, -- cgit v1.2.3