fix(utils/colors): properly sanitize color values

* fix(utils/colors): remove references to old functions
This commit is contained in:
tfuxu 2023-05-14 17:47:58 +02:00
parent 536854c037
commit 1a5b1f4cd4
No known key found for this signature in database
GPG key ID: 79CFC3B9B31C098A

View file

@ -105,14 +105,16 @@ def color_vars_to_color_code(variables: dict, palette: dict) -> dict:
elif var_type == "variable":
output[variable] = output[color_value]
if __has_variable_prefix(output[variable]):
__update_variable_vars(variable, output[variable])
color_variable_name = output[variable].strip()[1:]
if __has_palette_prefix(output[variable]):
__update_palette_vars(variable, output[variable])
__update_vars("palette", variable, color_variable_name)
if __has_variable_prefix(output[variable]):
__update_vars("variable", variable, color_variable_name)
for variable, color in output.items():
color_value = color[1:] # Remove '@' from the beginning of the color variable
color_value = color.strip()[1:] # Strip spaces and remove '@' from the beginning of the color variable
if __has_palette_prefix(color_value) and palette != None:
__update_vars("palette", variable, color_value)