diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-30 22:44:37 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-30 22:44:37 +1100 |
| commit | 55da502880549d9fd7f4bc01da58dcbccc55eb9a (patch) | |
| tree | ba9a662044824a50cf2d76122f0be782ee5f4b70 /scheme/getlightness.py | |
| parent | install: hypr optional trash-cli (diff) | |
| download | caelestia-cli-55da502880549d9fd7f4bc01da58dcbccc55eb9a.tar.gz caelestia-cli-55da502880549d9fd7f4bc01da58dcbccc55eb9a.tar.bz2 caelestia-cli-55da502880549d9fd7f4bc01da58dcbccc55eb9a.zip | |
scheme: better light/dark theme detection
Diffstat (limited to 'scheme/getlightness.py')
| -rwxr-xr-x | scheme/getlightness.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scheme/getlightness.py b/scheme/getlightness.py new file mode 100755 index 0000000..956153e --- /dev/null +++ b/scheme/getlightness.py @@ -0,0 +1,8 @@ +#!/bin/python3 + +import sys +from colorsys import rgb_to_hls + +if __name__ == "__main__": + for arg in sys.argv[1:]: + print(rgb_to_hls(*tuple(int(arg[i:i+2], 16) for i in (0, 2, 4)))[1]) |