mirror of
https://github.com/rio-labs/rio.git
synced 2026-02-09 07:09:00 -06:00
color bugfix + more work on theme generation function
This commit is contained in:
@@ -508,7 +508,7 @@ class Color(SelfSerializing):
|
||||
darken the color instead.
|
||||
"""
|
||||
# The amount may be negative. If that is the case, delegate to `darker`
|
||||
if amount <= 0:
|
||||
if amount < 0:
|
||||
return self.darker(-amount)
|
||||
|
||||
# HSV has an explicit value for brightness, so convert to HSV and bump
|
||||
@@ -550,7 +550,7 @@ class Color(SelfSerializing):
|
||||
the color instead.
|
||||
"""
|
||||
# The value may be negative. If that is the case, delegate to `brighter`
|
||||
if amount <= 0:
|
||||
if amount < 0:
|
||||
return self.brighter(-amount)
|
||||
|
||||
return Color._map_rgb(self, lambda x: max(x - amount, 0))
|
||||
|
||||
@@ -809,7 +809,6 @@ def _create_new_theme(
|
||||
"""
|
||||
Experimental next-gen theme creation function.
|
||||
"""
|
||||
|
||||
# Accent palette
|
||||
if accent_color is None:
|
||||
accent_color = rio.Color.from_rgb(red=0.3, green=0.55, blue=0.92)
|
||||
@@ -898,7 +897,11 @@ def _create_new_theme(
|
||||
|
||||
# Keep the disabled palette subdued. It's not meant to be perfectly
|
||||
# readable
|
||||
disabled_color = rio.Color.from_grey(0.6)
|
||||
disabled_color = _derive_color(
|
||||
neutral_color.desaturated(0.8),
|
||||
0.15,
|
||||
bias_to_bright=-0.3,
|
||||
)
|
||||
|
||||
disabled_palette = Palette(
|
||||
background=disabled_color,
|
||||
|
||||
Reference in New Issue
Block a user