From bdc5f91009945213d0cec74ae718761fa09fae57 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 10 Feb 2026 21:32:49 +1100 Subject: [PATCH] fix: xxx_paletteKeyColor rename in myc 3.0.0 Fixes caelestia-dots/shell#1112 --- src/caelestia/utils/material/generator.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/caelestia/utils/material/generator.py b/src/caelestia/utils/material/generator.py index 200fa7f..fb7b75b 100644 --- a/src/caelestia/utils/material/generator.py +++ b/src/caelestia/utils/material/generator.py @@ -172,10 +172,15 @@ def gen_scheme(scheme, primary: Hct) -> dict[str, str]: # Material colours primary_scheme = get_scheme(scheme.variant)(primary, not light, 0) - for colour in vars(MaterialDynamicColors).keys(): - colour_name = getattr(MaterialDynamicColors, colour) - if hasattr(colour_name, "get_hct"): - colours[colour] = colour_name.get_hct(primary_scheme) + dyn_colours = MaterialDynamicColors() + for colour in dyn_colours.all_colors: + colours[colour.name] = colour.get_hct(primary_scheme) + + # Backwards compatibility with old colour names + if "primaryPaletteKeyColor" in colours: # materialyoucolor-python >= 3.0.0 + for colour in "primary", "secondary", "tertiary", "neutral": + colours[f"{colour}_paletteKeyColor"] = colours[f"{colour}PaletteKeyColor"] + colours["neutral_variant_paletteKeyColor"] = colours["neutralVariantPaletteKeyColor"] # Harmonize terminal colours for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):