mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
re-work mmatugen meta theming
able to handle more rapid changes now, and colors look better
This commit is contained in:
@@ -23,19 +23,19 @@ def generate_palette(base_color, is_light=False, honor_primary=None):
|
||||
else:
|
||||
palette.append("#1a1a1a")
|
||||
|
||||
red_h = 0.0 # Force true red hue (0 degrees)
|
||||
red_h = 0.0
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(red_h, 0.75, 0.85)))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(red_h, 0.65, 1.0)))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(red_h, 0.6, 0.8)))
|
||||
|
||||
green_h = 0.33 # Force true green hue (120 degrees / 360 = 0.33)
|
||||
green_h = 0.33
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(green_h, max(s * 0.8, 0.65), v * 0.9)))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(green_h, max(s * 0.7, 0.6), v * 1.1)))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(green_h, max(s * 0.65, 0.5), v * 0.9)))
|
||||
|
||||
yellow_h = 0.16 # Force true yellow hue (60 degrees / 360 = 0.16)
|
||||
yellow_h = 0.16
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(yellow_h, max(s * 0.7, 0.55), v * 1.2)))
|
||||
else:
|
||||
@@ -44,17 +44,27 @@ def generate_palette(base_color, is_light=False, honor_primary=None):
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.9, 0.7), v * 1.1)))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.7, 0.6), min(v * 1.3, 0.9))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.8, 0.6), min(v * 1.6, 1.0))))
|
||||
|
||||
mag_h = h + 0.15 if h + 0.15 <= 1.0 else h + 0.15 - 1.0 # Derive from primary hue for harmony
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.8, 0.65), v * 0.95)))
|
||||
mag_h = h - 0.03 if h >= 0.03 else h + 0.97
|
||||
if honor_primary:
|
||||
hr, hg, hb = hex_to_rgb(honor_primary)
|
||||
hh, hs, hv = colorsys.rgb_to_hsv(hr, hg, hb)
|
||||
if is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(hh, max(hs * 0.9, 0.7), hv * 0.85)))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(hh, hs * 0.8, hv * 0.75)))
|
||||
elif is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.75, 0.6), v * 0.9)))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.65, 0.55), min(v * 1.15, 0.8))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.7, 0.6), v * 0.85)))
|
||||
|
||||
cyan_h = h + 0.08
|
||||
if honor_primary and not is_light:
|
||||
palette.append(honor_primary)
|
||||
if honor_primary:
|
||||
if is_light:
|
||||
palette.append(honor_primary)
|
||||
else:
|
||||
palette.append(honor_primary)
|
||||
elif is_light:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(cyan_h, max(s * 0.8, 0.65), v * 1.05)))
|
||||
else:
|
||||
@@ -71,7 +81,12 @@ def generate_palette(base_color, is_light=False, honor_primary=None):
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(red_h, 0.6, 0.9)))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(green_h, max(s * 0.7, 0.6), v * 1.25)))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(yellow_h, max(s * 0.6, 0.5), v * 1.35)))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.8, 0.7), min(v * 1.3, 1.0))))
|
||||
if honor_primary:
|
||||
hr, hg, hb = hex_to_rgb(honor_primary)
|
||||
hh, hs, hv = colorsys.rgb_to_hsv(hr, hg, hb)
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(hh, min(hs * 1.1, 1.0), min(hv * 1.2, 1.0))))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.8, 0.7), min(v * 1.3, 1.0))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.9, 0.75), min(v * 1.25, 1.0))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(cyan_h, max(s * 0.75, 0.65), min(v * 1.25, 1.0))))
|
||||
else:
|
||||
@@ -84,8 +99,8 @@ def generate_palette(base_color, is_light=False, honor_primary=None):
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(hh, min(hs * 1.2, 1.0), min(hv * 1.1, 1.0))))
|
||||
else:
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h, max(s * 0.6, 0.5), min(v * 1.5, 0.9))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.65, 0.55), min(v * 1.4, 0.85))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(cyan_h, max(s * 0.55, 0.45), min(v * 1.4, 0.85))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(mag_h, max(s * 0.7, 0.6), min(v * 1.3, 0.9))))
|
||||
palette.append(rgb_to_hex(*colorsys.hsv_to_rgb(h + 0.02 if h + 0.02 <= 1.0 else h + 0.02 - 1.0, max(s * 0.6, 0.5), min(v * 1.2, 0.85))))
|
||||
|
||||
if is_light:
|
||||
palette.append("#1a1a1a")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
background = {{colors.surface.default.hex}}
|
||||
foreground = {{colors.on_surface.default.hex}}
|
||||
cursor-color = {{colors.primary.default.hex}}
|
||||
selection-background = {{colors.surface_container.default.hex}}
|
||||
selection-background = {{colors.primary_container.default.hex}}
|
||||
selection-foreground = {{colors.on_surface.default.hex}}
|
||||
@@ -105,14 +105,6 @@ dnd {
|
||||
color: {{colors.on_surface.default.hex}};
|
||||
}
|
||||
|
||||
.normal-icons {
|
||||
-gtk-icon-size: 16px;
|
||||
}
|
||||
|
||||
.large-icons {
|
||||
-gtk-icon-size: 32px;
|
||||
}
|
||||
|
||||
.background:backdrop {
|
||||
background-color: {{colors.surface_dim.default.hex}};
|
||||
color: {{colors.on_surface_variant.default.hex}};
|
||||
|
||||
Reference in New Issue
Block a user