diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-11 23:53:21 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-11 23:53:21 +0300 |
| commit | 90e51f704bd1799fd9f26673991fd89cf52b13e1 (patch) | |
| tree | a16d1619b633bd2baf69712d077a9461ed7e4310 /src/config.rs | |
| parent | 6598c88d35268eec8f0902799152b34680f44fdd (diff) | |
feat: support transparent panel chrome
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 16 |
1 files changed, 15 insertions, 1 deletions
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 { @@ -1481,6 +1486,15 @@ name = "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##" [theme] |
