[+] Recommended color alignments

This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-06-19 22:37:27 -04:00
parent 59f5fd5651
commit d11796ef02
9 changed files with 132 additions and 48 deletions

View file

@ -2,6 +2,7 @@ from __future__ import annotations
import colorsys
from typing import NamedTuple
from typing_extensions import Literal
from .constants import GLOBAL_CFG
@ -184,3 +185,7 @@ class RGB(NamedTuple):
"""
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(h, light, s)])
def set_min_light(self, light: float) -> 'RGB':
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(h, max(l, light), s)])