From 5de1bf65e428c8fb3c31da6c17cab49ed2acf565 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Sun, 19 Jun 2022 17:39:39 -0400 Subject: [PATCH] [F] set_light should be float --- hyfetch/color_util.py | 4 ++-- hyfetch/main.py | 2 +- hyfetch/presets.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hyfetch/color_util.py b/hyfetch/color_util.py index 97ca043f..ef145440 100644 --- a/hyfetch/color_util.py +++ b/hyfetch/color_util.py @@ -170,11 +170,11 @@ class RGB(NamedTuple): """ 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 - :param light: Lightness value + :param light: Lightness value (0-1) :return: New color (original isn't modified) """ h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self]) diff --git a/hyfetch/main.py b/hyfetch/main.py index 733e7a28..b453689e 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -148,7 +148,7 @@ def create_config() -> Config: 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) # Create config diff --git a/hyfetch/presets.py b/hyfetch/presets.py index fd25bad8..415234b5 100644 --- a/hyfetch/presets.py +++ b/hyfetch/presets.py @@ -89,11 +89,11 @@ class ColorProfile: """ 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 - :param light: Lightness value + :param light: Lightness value (0-1) :return: New color profile (original isn't modified) """ return ColorProfile([c.set_light(light) for c in self.colors])