From 55da502880549d9fd7f4bc01da58dcbccc55eb9a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:44:37 +1100 Subject: scheme: better light/dark theme detection --- scheme/getlightness.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scheme/getlightness.py (limited to 'scheme/getlightness.py') 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]) -- cgit v1.2.3-freya