Switch to list for colors
This commit is contained in:
@@ -54,7 +54,12 @@ class Settings(dict):
|
||||
print(data)
|
||||
for key, value in data.items():
|
||||
print(key, value)
|
||||
if key == "color1":
|
||||
if key == "colors":
|
||||
buff = []
|
||||
for color in value:
|
||||
buff.append(tuple(int(color[i:i+2], 16) for i in self.color_order))
|
||||
patterns.set_colors(buff)
|
||||
elif key == "color1":
|
||||
patterns.set_color1(tuple(int(value[i:i+2], 16) for i in self.color_order)) # Convert hex to RGB
|
||||
elif key == "color2":
|
||||
patterns.set_color2(tuple(int(value[i:i+2], 16) for i in self.color_order)) # Convert hex to RGB
|
||||
@@ -84,6 +89,7 @@ class Settings(dict):
|
||||
else:
|
||||
return "Invalid key", 400
|
||||
self[key] = value
|
||||
#print(self)
|
||||
patterns.sync()
|
||||
if save:
|
||||
self.save()
|
||||
|
||||
Reference in New Issue
Block a user