1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

actually use matugen colors on b16

This commit is contained in:
bbedward
2025-08-25 16:49:46 -04:00
parent fb8aad52c4
commit 1c290fa9d7
3 changed files with 62 additions and 23 deletions

View File

@@ -7,6 +7,10 @@ def hex_to_rgb(hex_color):
return tuple(int(hex_color[i:i+2], 16)/255.0 for i in (0, 2, 4))
def rgb_to_hex(r, g, b):
# Clamp RGB values to valid range [0, 1]
r = max(0, min(1, r))
g = max(0, min(1, g))
b = max(0, min(1, b))
return f"#{int(r*255):02x}{int(g*255):02x}{int(b*255):02x}"
def generate_palette(base_color, is_light=False):