summaryrefslogtreecommitdiffstats
path: root/src/style.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-05-17 18:19:57 -0400
committerDan Davison <dandavison7@gmail.com>2020-05-22 13:57:52 -0400
commitf08effc46de52655c8431498c6bc214c0eda30e5 (patch)
tree4fd806d5199b42f3ce77c87050795f59408b1a24 /src/style.rs
parent54da480bd0465daf698f2566c454e0921110d69c (diff)
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.
Diffstat (limited to 'src/style.rs')
-rw-r--r--src/style.rs12
1 files changed, 12 insertions, 0 deletions
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,