diff --git a/assets/themes.bin b/assets/themes.bin index 484b3fbc..1186d8b9 100644 Binary files a/assets/themes.bin and b/assets/themes.bin differ diff --git a/assets/themes/base16.tmTheme b/assets/themes/base16.tmTheme index eff2eba4..bb8e6a80 100644 --- a/assets/themes/base16.tmTheme +++ b/assets/themes/base16.tmTheme @@ -3,8 +3,8 @@ author @@ -19,21 +19,21 @@ settings background - #00000000 + #0000000f caret - #07000000 + #0700000f foreground - #07000000 + #0700000f invisibles - #08000000 + #0800000f lineHighlight - #08000000 + #0800000f selection - #0b000000 + #0b00000f gutter - #0a000000 + #0a00000f gutterForeground - #08000000 + #0800000f @@ -44,7 +44,7 @@ settings foreground - #07000000 + #0700000f @@ -55,7 +55,7 @@ settings foreground - #08000000 + #0800000f @@ -66,7 +66,7 @@ settings foreground - #07000000 + #0700000f @@ -77,7 +77,7 @@ settings foreground - #07000000 + #0700000f @@ -88,7 +88,7 @@ settings foreground - #07000000 + #0700000f @@ -99,7 +99,7 @@ settings foreground - #05000000 + #0500000f @@ -110,7 +110,7 @@ settings foreground - #07000000 + #0700000f @@ -121,7 +121,7 @@ settings foreground - #04000000 + #0400000f @@ -132,7 +132,7 @@ settings foreground - #0e000000 + #0e00000f @@ -143,7 +143,7 @@ settings foreground - #03000000 + #0300000f @@ -154,7 +154,7 @@ settings foreground - #0f000000 + #0f00000f @@ -165,7 +165,7 @@ settings foreground - #04000000 + #0400000f @@ -176,7 +176,7 @@ settings foreground - #05000000 + #0500000f @@ -187,7 +187,7 @@ settings foreground - #06000000 + #0600000f @@ -198,7 +198,7 @@ settings foreground - #02000000 + #0200000f @@ -209,7 +209,7 @@ settings foreground - #09000000 + #0900000f @@ -220,7 +220,7 @@ settings foreground - #09000000 + #0900000f @@ -231,7 +231,7 @@ settings foreground - #09000000 + #0900000f @@ -242,7 +242,7 @@ settings foreground - #09000000 + #0900000f @@ -253,7 +253,7 @@ settings foreground - #01000000 + #0100000f @@ -264,7 +264,7 @@ settings foreground - #09000000 + #0900000f @@ -275,7 +275,7 @@ settings foreground - #04000000 + #0400000f @@ -286,7 +286,7 @@ settings foreground - #05000000 + #0500000f @@ -297,7 +297,7 @@ settings foreground - #09000000 + #0900000f @@ -310,7 +310,7 @@ fontStyle foreground - #04000000 + #0400000f @@ -321,7 +321,7 @@ settings foreground - #09000000 + #0900000f @@ -334,7 +334,7 @@ fontStyle bold foreground - #03000000 + #0300000f @@ -347,7 +347,7 @@ fontStyle italic foreground - #05000000 + #0500000f @@ -358,7 +358,7 @@ settings foreground - #02000000 + #0200000f @@ -369,7 +369,7 @@ settings foreground - #01000000 + #0100000f @@ -380,7 +380,7 @@ settings foreground - #09000000 + #0900000f @@ -391,7 +391,7 @@ settings foreground - #09000000 + #0900000f @@ -402,9 +402,9 @@ settings background - #0b000000 + #0b00000f foreground - #07000000 + #0700000f @@ -415,7 +415,7 @@ settings foreground - #02000000 + #0200000f @@ -426,7 +426,7 @@ settings foreground - #01000000 + #0100000f @@ -437,7 +437,7 @@ settings foreground - #05000000 + #0500000f @@ -448,7 +448,7 @@ settings foreground - #06000000 + #0600000f @@ -459,7 +459,7 @@ settings foreground - #06000000 + #0600000f @@ -470,7 +470,7 @@ settings foreground - #06000000 + #0600000f @@ -481,7 +481,7 @@ settings foreground - #05000000 + #0500000f @@ -492,9 +492,9 @@ settings background - #01000000 + #0100000f foreground - #0f000000 + #0f00000f @@ -505,9 +505,9 @@ settings background - #09000000 + #0900000f foreground - #00000000 + #0000000f @@ -518,9 +518,9 @@ settings background - #0e000000 + #0e00000f foreground - #0f000000 + #0f00000f @@ -531,9 +531,9 @@ settings background - #08000000 + #0800000f foreground - #0f000000 + #0f00000f diff --git a/src/terminal.rs b/src/terminal.rs index 981bf3b2..9f2c4dd1 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -1,15 +1,37 @@ -use ansi_term::Colour::{Fixed, RGB}; +use ansi_term::Color::{self, Fixed, RGB}; use ansi_term::{self, Style}; use syntect::highlighting::{self, FontStyle}; -pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> ansi_term::Colour { +pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> ansi_term::Color { if color.a == 0 { // Themes can specify one of the user-configurable terminal colors by // encoding them as #RRGGBBAA with AA set to 00 (transparent) and RR set // to the color palette number. The built-in themes ansi-light, // ansi-dark, and base16 use this. Fixed(color.r) + } else if color.a == 0x0f { + match color.r { + 0x00 => Color::Black, + 0x01 => Color::Red, + 0x02 => Color::Green, + 0x03 => Color::Yellow, + 0x04 => Color::Blue, + 0x05 => Color::Purple, + 0x06 => Color::Cyan, + 0x07 => Color::White, + // TODO: the following should be high-intensity variants of + // these colors ("bright black", "bright red", ...). + 0x08 => Color::Black, + 0x09 => Color::Red, + 0x0a => Color::Green, + 0x0b => Color::Yellow, + 0x0c => Color::Blue, + 0x0d => Color::Purple, + 0x0e => Color::Cyan, + 0x0f => Color::White, + _ => unreachable!("The 0x0f color encoding does not allow for codes higher than 0x0f") + } } else if true_color { RGB(color.r, color.g, color.b) } else {