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 "%02x\n" ${r})
+ gH=$(printf "%02x\n" ${g})
+ bH=$(printf "%02x\n" ${b})
for i in {1..10}; do
echo -e "\033[48;2;${r};${g};${b}m \e[0m"
done