summaryrefslogtreecommitdiff
path: root/bin/common/hextorgb
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-15 16:31:56 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-15 16:47:43 +0100
commit3b2a78935fd6550521f719a10e5b0fceb1ddb350 (patch)
tree7c50801d6bb5b7abba3df6352ed43df454a4dbcb /bin/common/hextorgb
Not really but, First commit!
Diffstat (limited to 'bin/common/hextorgb')
-rwxr-xr-xbin/common/hextorgb7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/common/hextorgb b/bin/common/hextorgb
new file mode 100755
index 0000000..b268db5
--- /dev/null
+++ b/bin/common/hextorgb
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+cat /dev/stdin \
+ | tr -d '#' | tr '[:lower:]' '[:upper:]' \
+ | sed -r 's/([0-9A-F]{2})/\1\n/g ; i ibase=16' \
+ | bc \
+ | tr '\n' ',' \
+ | sed 's/.$// ; s/.*/rgb(&)/'