From 81b068a4d19424d510f48f495b4cf4049ea3b046 Mon Sep 17 00:00:00 2001 From: CM Geldenhuys <4649249+CMGeldenhuys@users.noreply.github.com> Date: Mon, 4 May 2026 20:02:15 +0200 Subject: [PATCH] fix(config): map bonsai colors in eight-color fallback When a config predates true-color mode (no RGB values present), the migrator switches `full_color` off and remaps the legacy animations' colors to 8-color palette indices. The new `bonsai_*` color fields were absent from that remap, so their 24-bit RGB defaults were sent to a terminal in 8-color output mode and rendered as the default foreground. Extend `color_properties` and `lateConfigFieldHandler` so that, in 8-color fallback, leaf colors map to ECOL_GREEN (bright = bold) and wood colors map to ECOL_YELLOW (bright = bold). User-provided RGB values for any of these fields disable the 8-color heuristic, matching how the existing animations behave. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/config/migrator.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/config/migrator.zig b/src/config/migrator.zig index 366bc81..c06e721 100644 --- a/src/config/migrator.zig +++ b/src/config/migrator.zig @@ -28,10 +28,15 @@ const color_properties = [_][]const u8{ "error_bg", "error_fg", "fg", + "bonsai_leaf_dark", + "bonsai_leaf_bright", + "bonsai_wood_dark", + "bonsai_wood_bright", + "bonsai_text_color", }; var set_color_properties = - [_]bool{ false, false, false, false, false, false, false, false, false }; + [_]bool{false} ** color_properties.len; const removed_properties = [_][]const u8{ "wayland_specifier", @@ -251,6 +256,11 @@ pub fn lateConfigFieldHandler(config: *Config) void { if (!set_color_properties[6]) config.error_bg = Color.DEFAULT; if (!set_color_properties[7]) config.error_fg = Styling.BOLD | Color.ECOL_RED; if (!set_color_properties[8]) config.fg = Color.ECOL_WHITE; + if (!set_color_properties[9]) config.bonsai_leaf_dark = Color.ECOL_GREEN; + if (!set_color_properties[10]) config.bonsai_leaf_bright = Styling.BOLD | Color.ECOL_GREEN; + if (!set_color_properties[11]) config.bonsai_wood_dark = Color.ECOL_YELLOW; + if (!set_color_properties[12]) config.bonsai_wood_bright = Styling.BOLD | Color.ECOL_YELLOW; + if (!set_color_properties[13]) config.bonsai_text_color = Color.ECOL_WHITE; } }