Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
fix(utils/colors): properly sanitize color values
Browse files Browse the repository at this point in the history
    * fix(utils/colors): remove references to old functions
  • Loading branch information
tfuxu committed May 14, 2023
1 parent 536854c commit 1a5b1f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gradience/backend/utils/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ def __update_vars(var_type, variable, color_value):
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)
Expand Down

0 comments on commit 1a5b1f4

Please sign in to comment.