[+] Recommended color alignments
This commit is contained in:
parent
59f5fd5651
commit
d11796ef02
9 changed files with 132 additions and 48 deletions
|
|
@ -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)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue