From 43d17c482cda07fa0dc4985d60c14391a4926940 Mon Sep 17 00:00:00 2001 From: NNB Date: Thu, 11 Nov 2021 15:23:27 +0700 Subject: Fix Base16 Dark, add Base16 Light and Terminal Improve accuracy with line number and cursor color --- runtime/themes/base16_default_light.toml | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 runtime/themes/base16_default_light.toml (limited to 'runtime/themes/base16_default_light.toml') diff --git a/runtime/themes/base16_default_light.toml b/runtime/themes/base16_default_light.toml new file mode 100644 index 00000000..d9f1e0ba --- /dev/null +++ b/runtime/themes/base16_default_light.toml @@ -0,0 +1,60 @@ +# Author: NNB + +"ui.background" = { bg = "base00" } +"ui.menu" = "base01" +"ui.menu.selected" = { fg = "base04", bg = "base01" } +"ui.linenr" = { fg = "base03", bg = "base01" } +"ui.popup" = { bg = "base01" } +"ui.window" = { bg = "base01" } +"ui.linenr.selected" = { fg = "base04", bg = "base01", modifiers = ["bold"] } +"ui.selection" = { bg = "base02" } +"comment" = { fg = "base03", modifiers = ["italic"] } +"ui.statusline" = { fg = "base04", bg = "base01" } +"ui.help" = { fg = "base04", bg = "base01" } +"ui.cursor" = { fg = "base04", modifiers = ["reversed"] } +"ui.cursor.primary" = { fg = "base05", modifiers = ["reversed"] } +"ui.text" = "base05" +"operator" = "base05" +"ui.text.focus" = "base05" +"variable" = "base08" +"constant.numeric" = "base09" +"constant" = "base09" +"attributes" = "base09" +"type" = "base0A" +"ui.cursor.match" = { fg = "base0A", modifiers = ["underlined"] } +"string" = "base0B" +"variable.other.member" = "base0B" +"constant.character.escape" = "base0C" +"function" = "base0D" +"constructor" = "base0D" +"special" = "base0D" +"keyword" = "base0E" +"label" = "base0E" +"namespace" = "base0E" +"ui.popup" = { bg = "base01" } +"ui.window" = { bg = "base00" } +"ui.help" = { fg = "base06", bg = "base01" } + +"info" = "base03" +"hint" = "base03" +"debug" = "base03" +"diagnostic" = "base03" +"error" = "base0E" + +[palette] +base00 = "#f8f8f8" # Default Background +base01 = "#e8e8e8" # Lighter Background (Used for status bars, line number and folding marks) +base02 = "#d8d8d8" # Selection Background +base03 = "#b8b8b8" # Comments, Invisibles, Line Highlighting +base04 = "#585858" # Dark Foreground (Used for status bars) +base05 = "#383838" # Default Foreground, Caret, Delimiters, Operators +base06 = "#282828" # Light Foreground (Not often used) +base07 = "#181818" # Light Background (Not often used) +base08 = "#ab4642" # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 = "#dc9656" # Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A = "#f7ca88" # Classes, Markup Bold, Search Text Background +base0B = "#a1b56c" # Strings, Inherited Class, Markup Code, Diff Inserted +base0C = "#86c1b9" # Support, Regular Expressions, Escape Characters, Markup Quotes +base0D = "#7cafc2" # Functions, Methods, Attribute IDs, Headings +base0E = "#ba8baf" # Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F = "#a16946" # Deprecated, Opening/Closing Embedded Language Tags, e.g. -- cgit v1.2.3-70-g09d2 From 3080be82687548e06a05e517e09a36721b769f03 Mon Sep 17 00:00:00 2001 From: NNB Date: Thu, 2 Dec 2021 17:22:27 +0700 Subject: Fix error color, add tty theme --- base16_terminal.toml | 2 +- runtime/themes/base16_default_dark.toml | 2 +- runtime/themes/base16_default_light.toml | 2 +- runtime/themes/base16_tty.toml | 41 ++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 runtime/themes/base16_tty.toml (limited to 'runtime/themes/base16_default_light.toml') diff --git a/base16_terminal.toml b/base16_terminal.toml index bf3c73f1..e613526f 100644 --- a/base16_terminal.toml +++ b/base16_terminal.toml @@ -38,4 +38,4 @@ "hint" = "light-gray" "debug" = "light-gray" "diagnostic" = "light-gray" -"error" = "light-magenta" +"error" = "light-red" diff --git a/runtime/themes/base16_default_dark.toml b/runtime/themes/base16_default_dark.toml index 15c094a6..3472162b 100644 --- a/runtime/themes/base16_default_dark.toml +++ b/runtime/themes/base16_default_dark.toml @@ -39,7 +39,7 @@ "hint" = "base03" "debug" = "base03" "diagnostic" = "base03" -"error" = "base0E" +"error" = "base08" [palette] base00 = "#181818" # Default Background diff --git a/runtime/themes/base16_default_light.toml b/runtime/themes/base16_default_light.toml index d9f1e0ba..d864fd5f 100644 --- a/runtime/themes/base16_default_light.toml +++ b/runtime/themes/base16_default_light.toml @@ -39,7 +39,7 @@ "hint" = "base03" "debug" = "base03" "diagnostic" = "base03" -"error" = "base0E" +"error" = "base08" [palette] base00 = "#f8f8f8" # Default Background diff --git a/runtime/themes/base16_tty.toml b/runtime/themes/base16_tty.toml new file mode 100644 index 00000000..480bcd9c --- /dev/null +++ b/runtime/themes/base16_tty.toml @@ -0,0 +1,41 @@ +# Author: NNB + +"ui.menu" = "black" +"ui.menu.selected" = { fg = "white", bg = "black" } +"ui.linenr" = { fg = "gray", bg = "black" } +"ui.popup" = { bg = "black" } +"ui.window" = { bg = "black" } +"ui.linenr.selected" = { fg = "white", bg = "black", modifiers = ["bold"] } +"ui.selection" = { fg = "black", bg = "blue" } +"ui.selection.primary" = { fg = "white", bg = "blue" } +"comment" = { fg = "gray" } +"ui.statusline" = { fg = "white", bg = "black" } +"ui.help" = { fg = "white", bg = "black" } +"ui.cursor" = { fg = "white", modifiers = ["reversed"] } #FIXME +"ui.text" = "white" #FIXME +"operator" = "white" #FIXME +"ui.text.focus" = "white" #FIXME +"variable" = "red" +"constant.numeric" = "yellow" +"constant" = "yellow" +"attributes" = "yellow" +"type" = "yellow" +"ui.cursor.match" = { fg = "yellow", modifiers = ["underlined"] } +"string" = "green" +"variable.other.member" = "green" +"constant.character.escape" = "cyan" +"function" = "blue" +"constructor" = "blue" +"special" = "blue" +"keyword" = "magenta" +"label" = "magenta" +"namespace" = "magenta" +"ui.popup" = { bg = "black" } +"ui.window" = { bg = "base00" } +"ui.help" = { fg = "white", bg = "black" } + +"info" = "gray" +"hint" = "gray" +"debug" = "gray" +"diagnostic" = "gray" +"error" = "red" -- cgit v1.2.3-70-g09d2 From d9727868dd7a496d33a321faeacfcd02d8c1c06e Mon Sep 17 00:00:00 2001 From: NNB Date: Thu, 2 Dec 2021 19:33:31 +0700 Subject: change to .unwrap_or_default() and fix ui.window and ui.statusline --- base16_terminal.toml | 10 +++------- helix-view/src/theme.rs | 2 +- runtime/themes/base16_default_dark.toml | 4 +--- runtime/themes/base16_default_light.toml | 4 +--- runtime/themes/base16_tty.toml | 17 ++++++----------- 5 files changed, 12 insertions(+), 25 deletions(-) (limited to 'runtime/themes/base16_default_light.toml') diff --git a/base16_terminal.toml b/base16_terminal.toml index e613526f..a76cfd7e 100644 --- a/base16_terminal.toml +++ b/base16_terminal.toml @@ -1,7 +1,7 @@ # Author: NNB "ui.menu" = "black" -"ui.menu.selected" = { fg = "white", bg = "black" } +"ui.menu.selected" = { modifiers = ["reversed"] } "ui.linenr" = { fg = "light-gray", bg = "black" } "ui.popup" = { bg = "black" } "ui.window" = { bg = "black" } @@ -9,12 +9,10 @@ "ui.selection" = { fg = "gray", modifiers = ["reversed"] } "comment" = { fg = "light-gray", modifiers = ["italic"] } "ui.statusline" = { fg = "white", bg = "black" } +"ui.statusline.inactive" = { fg = "gray", bg = "black" } "ui.help" = { fg = "white", bg = "black" } "ui.cursor" = { fg = "light-gray", modifiers = ["reversed"] } -"ui.cursor.primary" = { fg = "white", modifiers = ["reversed"] } #FIXME -"ui.text" = "white" #FIXME -"operator" = "white" #FIXME -"ui.text.focus" = "white" #FIXME +"ui.cursor.primary" = { modifiers = ["reversed"] } "variable" = "light-red" "constant.numeric" = "yellow" "constant" = "yellow" @@ -30,8 +28,6 @@ "keyword" = "light-magenta" "label" = "light-magenta" "namespace" = "light-magenta" -"ui.popup" = { bg = "black" } -"ui.window" = { bg = "base00" } "ui.help" = { fg = "white", bg = "black" } "info" = "light-gray" diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index a5dc0609..6ca021a9 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -151,7 +151,7 @@ impl Theme { pub fn get(&self, scope: &str) -> Style { self.try_get(scope) - .unwrap_or_else(|| Style::default().fg(Color::Rgb(0, 0, 255))) + .unwrap_or_default() } pub fn try_get(&self, scope: &str) -> Option