diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-29 12:04:35 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-29 12:04:35 +1100 |
| commit | 53170f3ad0bd12d937e7bfb8e70c7825fec0a6b7 (patch) | |
| tree | 7cfa7087da4e6228803800138effdb0a123e5dcd /scheme | |
| parent | scheme: better colour generation (diff) | |
| download | caelestia-cli-53170f3ad0bd12d937e7bfb8e70c7825fec0a6b7.tar.gz caelestia-cli-53170f3ad0bd12d937e7bfb8e70c7825fec0a6b7.tar.bz2 caelestia-cli-53170f3ad0bd12d937e7bfb8e70c7825fec0a6b7.zip | |
scheme: better dynamic monochrome
Diffstat (limited to 'scheme')
| -rwxr-xr-x | scheme/autoadjust.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scheme/autoadjust.py b/scheme/autoadjust.py index 9c7ea9f..10e65c2 100755 --- a/scheme/autoadjust.py +++ b/scheme/autoadjust.py @@ -98,7 +98,7 @@ def adjust(hex: str, light: float = 0, sat: float = 0) -> str: def grayscale(hex: str, light: bool) -> str: h, l, s = hex_to_hls(hex) - return hls_to_hex(h, min(0.5, l) if light else max(0.5, l), 0) + return hls_to_hex(h, 0.5 - l / 2 if light else l / 2 + 0.5, 0) def distance(colour: str, base: str) -> float: |