whexsafe (472B)
1 #!/bin/bash 2 # Generates the web safe colors list in hexadecimal. 3 4 main() { 5 rgb=(0 3 6 9 C F) 6 for r in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) 7 do 8 for g in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) 9 do 10 for b in $(seq 0 $(echo ${#rgb[@]} - 1|bc)) 11 do 12 rh=${rgb[$r]} 13 gh=${rgb[$g]} 14 bh=${rgb[$b]} 15 rn=$(echo "${r}*51" | bc) 16 gn=$(echo "${g}*51" | bc) 17 bn=$(echo "${b}*51" | bc) 18 echo "#${rh}${gh}${bh} rgb(${rn}, ${gn}, ${bn})" 19 done 20 done 21 done 22 } 23 24 main