diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 18:17:13 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 18:17:13 +1100 |
| commit | 5118c8da96312627b86c55738c02c6c8ac6809d0 (patch) | |
| tree | ea620f10aa317927879ecbdd1eef9246186f047d /scheme/islight.py | |
| parent | install: hypr install uwsm envs (diff) | |
| download | caelestia-cli-5118c8da96312627b86c55738c02c6c8ac6809d0.tar.gz caelestia-cli-5118c8da96312627b86c55738c02c6c8ac6809d0.tar.bz2 caelestia-cli-5118c8da96312627b86c55738c02c6c8ac6809d0.zip | |
scheme: dynamic light theme
Autodetect based on wallpaper
Also resize wallpaper so faster
And async magick blur so wallpaper doesnt block
Diffstat (limited to 'scheme/islight.py')
| -rwxr-xr-x | scheme/islight.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scheme/islight.py b/scheme/islight.py new file mode 100755 index 0000000..1adcf3f --- /dev/null +++ b/scheme/islight.py @@ -0,0 +1,16 @@ +#!/bin/python + +import sys +from PIL import Image +from materialyoucolor.quantize import QuantizeCelebi +from materialyoucolor.score.score import Score +from materialyoucolor.hct import Hct +from resizeimg import resize + + +if __name__ == "__main__": + with Image.open(sys.argv[1]) as img: + img = resize(img)[0] + colours = QuantizeCelebi(list(img.getdata()), 128) + hct = Hct.from_int(Score.score(colours)[0]) + sys.exit(0 if hct.tone > 60 else 1) |