From 90e51f704bd1799fd9f26673991fd89cf52b13e1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 11 Apr 2026 23:53:21 +0300 Subject: feat: support transparent panel chrome --- src/config.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index b57d67f4..ce317d33 100644 --- a/src/config.rs +++ b/src/config.rs @@ -750,11 +750,16 @@ pub struct Keybinds { } /// Parse a color string into a ratatui Color. -/// Supports: hex (#rrggbb, #rgb), named colors, rgb(r,g,b). +/// Supports: hex (#rrggbb, #rgb), named colors, rgb(r,g,b), and reset aliases. pub fn parse_color(s: &str) -> ratatui::style::Color { use ratatui::style::Color; let s = s.trim().to_lowercase(); + match s.as_str() { + "reset" | "default" | "none" | "transparent" => return Color::Reset, + _ => {} + } + // Hex: #rrggbb or #rgb if let Some(hex) = s.strip_prefix('#') { if hex.len() == 6 { @@ -1480,6 +1485,15 @@ name = "dracula" assert_eq!(config.theme.name.as_deref(), Some("dracula")); } + #[test] + fn parse_color_accepts_reset_aliases() { + use ratatui::style::Color; + + for value in ["reset", "default", "none", "transparent"] { + assert_eq!(parse_color(value), Color::Reset, "value: {value}"); + } + } + #[test] fn theme_custom_overrides_parse() { let toml = r##" -- cgit v1.2.3