mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 14:59:29 -05:00
fix: xxx_paletteKeyColor rename in myc 3.0.0
Fixes caelestia-dots/shell#1112
This commit is contained in:
@@ -172,10 +172,15 @@ def gen_scheme(scheme, primary: Hct) -> dict[str, str]:
|
|||||||
|
|
||||||
# Material colours
|
# Material colours
|
||||||
primary_scheme = get_scheme(scheme.variant)(primary, not light, 0)
|
primary_scheme = get_scheme(scheme.variant)(primary, not light, 0)
|
||||||
for colour in vars(MaterialDynamicColors).keys():
|
dyn_colours = MaterialDynamicColors()
|
||||||
colour_name = getattr(MaterialDynamicColors, colour)
|
for colour in dyn_colours.all_colors:
|
||||||
if hasattr(colour_name, "get_hct"):
|
colours[colour.name] = colour.get_hct(primary_scheme)
|
||||||
colours[colour] = colour_name.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
|
# Harmonize terminal colours
|
||||||
for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):
|
for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):
|
||||||
|
|||||||
Reference in New Issue
Block a user