summaryrefslogtreecommitdiff
path: root/scheme/getlightness.py
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/getlightness.py')
-rwxr-xr-xscheme/getlightness.py8
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])