Files
caelestia-cli/scheme/islight.py
T
2 * r + 2 * t 5118c8da96 scheme: dynamic light theme
Autodetect based on wallpaper
Also resize wallpaper so faster
And async magick blur so wallpaper doesnt block
2025-01-29 18:17:13 +11:00

17 lines
468 B
Python
Executable File

#!/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)