[F] set_light should be float
This commit is contained in:
parent
b46d0e96f4
commit
5de1bf65e4
3 changed files with 5 additions and 5 deletions
|
@ -170,11 +170,11 @@ class RGB(NamedTuple):
|
||||||
"""
|
"""
|
||||||
return RGB(*redistribute_rgb(*[v * multiplier for v in self]))
|
return RGB(*redistribute_rgb(*[v * multiplier for v in self]))
|
||||||
|
|
||||||
def set_light(self, light: int) -> 'RGB':
|
def set_light(self, light: float) -> 'RGB':
|
||||||
"""
|
"""
|
||||||
Set HSL lightness value
|
Set HSL lightness value
|
||||||
|
|
||||||
:param light: Lightness value
|
:param light: Lightness value (0-1)
|
||||||
:return: New color (original isn't modified)
|
:return: New color (original isn't modified)
|
||||||
"""
|
"""
|
||||||
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
|
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
|
||||||
|
|
|
@ -148,7 +148,7 @@ def create_config() -> Config:
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print()
|
print()
|
||||||
tmp = PRESETS['rainbow'].color_text('preset')
|
tmp = PRESETS['rainbow'].set_light(.5).color_text('preset')
|
||||||
preset = literal_input(f'Which {tmp} do you want to use?', PRESETS.keys(), 'rainbow', show_ops=False)
|
preset = literal_input(f'Which {tmp} do you want to use?', PRESETS.keys(), 'rainbow', show_ops=False)
|
||||||
|
|
||||||
# Create config
|
# Create config
|
||||||
|
|
|
@ -89,11 +89,11 @@ class ColorProfile:
|
||||||
"""
|
"""
|
||||||
return ColorProfile([c.lighten(multiplier) for c in self.colors])
|
return ColorProfile([c.lighten(multiplier) for c in self.colors])
|
||||||
|
|
||||||
def set_light(self, light: int):
|
def set_light(self, light: float):
|
||||||
"""
|
"""
|
||||||
Set HSL lightness value
|
Set HSL lightness value
|
||||||
|
|
||||||
:param light: Lightness value
|
:param light: Lightness value (0-1)
|
||||||
:return: New color profile (original isn't modified)
|
:return: New color profile (original isn't modified)
|
||||||
"""
|
"""
|
||||||
return ColorProfile([c.set_light(light) for c in self.colors])
|
return ColorProfile([c.set_light(light) for c in self.colors])
|
||||||
|
|
Loading…
Reference in a new issue