From 1978eba0a13e4c78797684754ccf14ef5e880f83 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 19 Oct 2020 22:03:21 -0700 Subject: [PATCH] wezterm: make the split color configurable and darker This makes the color of the split divider darker by default, and configurable via the color scheme configuration file. refs: #297 --- config/src/color.rs | 3 +++ docs/config/appearance.markdown | 3 +++ term/src/color.rs | 4 ++++ wezterm/src/gui/termwindow.rs | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/src/color.rs b/config/src/color.rs index 72335d88e..90d31176c 100644 --- a/config/src/color.rs +++ b/config/src/color.rs @@ -26,6 +26,8 @@ pub struct Palette { /// The color of the "thumb" of the scrollbar; the segment that /// represents the current viewable area pub scrollbar_thumb: Option, + /// The color of the split line between panes + pub split: Option, } impl_lua_conversion!(Palette); @@ -47,6 +49,7 @@ impl From for wezterm_term::color::ColorPalette { apply_color!(selection_fg); apply_color!(selection_bg); apply_color!(scrollbar_thumb); + apply_color!(split); if let Some(ansi) = cfg.ansi { for (idx, col) in ansi.iter().enumerate() { diff --git a/docs/config/appearance.markdown b/docs/config/appearance.markdown index 5fd4979cb..a9c33196b 100644 --- a/docs/config/appearance.markdown +++ b/docs/config/appearance.markdown @@ -47,6 +47,9 @@ return { -- The color of the scrollbar "thumb"; the portion that represents the current viewport scrollbar_thumb = "#222222", + -- The color of the split lines between panes + split = "#444444", + ansi = {"black", "maroon", "green", "olive", "navy", "purple", "teal", "silver"}, brights = {"grey", "red", "lime", "yellow", "blue", "fuchsia", "aqua", "white"}, } diff --git a/term/src/color.rs b/term/src/color.rs index fe6cbdfb2..afafa81ea 100644 --- a/term/src/color.rs +++ b/term/src/color.rs @@ -28,6 +28,7 @@ pub struct ColorPalette { pub selection_fg: RgbColor, pub selection_bg: RgbColor, pub scrollbar_thumb: RgbColor, + pub split: RgbColor, } /// Adjust the color to make it appear disabled. @@ -88,6 +89,7 @@ impl ColorPalette { selection_fg: grey_out(self.selection_fg), selection_bg: grey_out(self.selection_bg), scrollbar_thumb: grey_out(self.scrollbar_thumb), + split: grey_out(self.split), } } } @@ -232,6 +234,7 @@ impl Default for ColorPalette { let selection_bg = RgbColor::new(0xff, 0xfa, 0xcd); let scrollbar_thumb = RgbColor::new(0x22, 0x22, 0x22); + let split = RgbColor::new(0x44, 0x44, 0x44); ColorPalette { colors: Palette256(colors), @@ -243,6 +246,7 @@ impl Default for ColorPalette { selection_fg, selection_bg, scrollbar_thumb, + split, } } } diff --git a/wezterm/src/gui/termwindow.rs b/wezterm/src/gui/termwindow.rs index 239900e2b..0d97a9bae 100644 --- a/wezterm/src/gui/termwindow.rs +++ b/wezterm/src/gui/termwindow.rs @@ -2255,7 +2255,7 @@ impl TermWindow { "─" }; let palette = pane.palette(); - let foreground = rgbcolor_to_window_color(palette.foreground); + let foreground = rgbcolor_to_window_color(palette.split); let background = rgbcolor_alpha_to_window_color( palette.background, if self.window_background.is_none() && config.window_background_opacity == 1.0 {