From 5118c8da96312627b86c55738c02c6c8ac6809d0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:17:13 +1100 Subject: scheme: dynamic light theme Autodetect based on wallpaper Also resize wallpaper so faster And async magick blur so wallpaper doesnt block --- scheme/islight.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scheme/islight.py (limited to 'scheme/islight.py') 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) -- cgit v1.2.3-freya