git.slaskete.net
/
einar-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0deae0c
)
Husk zeropad på hex-verdier
master
author
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Wed, 1 Jan 2025 15:28:18 +0000
(16:28 +0100)
committer
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Wed, 1 Jan 2025 15:28:18 +0000
(16:28 +0100)
colorscan.sh
patch
|
blob
|
history
diff --git
a/colorscan.sh
b/colorscan.sh
index bcb9689721a4293292435317884a4d27c8f6af1a..c57872af9b11dd3507cd174eed29c8a2aa45a2d8 100755
(executable)
--- a/
colorscan.sh
+++ b/
colorscan.sh
@@
-11,9
+11,9
@@
while read scan; do
r=$(echo "${rgb}" | cut -f 1 -d "," | tr -d " ")
g=$(echo "${rgb}" | cut -f 2 -d "," | tr -d " ")
b=$(echo "${rgb}" | cut -f 3 -d "," | tr -d " ")
- rH=$(printf "%x\n" ${r})
- gH=$(printf "%x\n" ${g})
- bH=$(printf "%x\n" ${b})
+ rH=$(printf "%
02
x\n" ${r})
+ gH=$(printf "%
02
x\n" ${g})
+ bH=$(printf "%
02
x\n" ${b})
for i in {1..10}; do
echo -e "\033[48;2;${r};${g};${b}m \e[0m"
done