]> git.wh0rd.org - home.git/commitdiff
add 256 colors
authorMike Frysinger <vapier@gentoo.org>
Fri, 15 Feb 2013 22:54:14 +0000 (17:54 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 15 Feb 2013 22:58:47 +0000 (17:58 -0500)
.bin/bash-colors

index 04c637682d3dd7f191f5003cf925a232f09d7b1d..d7076fab002204d2af3077ec6069b4435f4279fc 100755 (executable)
@@ -17,8 +17,31 @@ if [[ $1 == "--env" ]] ; then
        exit 0
 fi
 
-for i in {0..1} ; do
-       for j in {30..37} ; do
-               echo -e '\e['"${i};${j}mthis color is: \\\\e[${i};${j}m"
+showit() {
+       echo -e '\e['"${1};${2}mthis color is: \\\\e[${1};${2}m    \e[0m"
+}
+case $1 in
+""|16|system)
+       for i in {0..1} ; do
+               for j in {30..37} ; do
+                       showit ${i} ${j}
+               done
        done
-done
+       ;;
+cube|6x6x6)
+       for n in {16..231} ; do
+               showit "38;05" $(printf '%03i' ${n})
+       done
+       ;;
+gr[ae]y)
+       for n in {232..255} ; do
+               showit "38;05" ${n}
+       done
+       ;;
+all|256)
+       for x in system cube gray ; do
+               echo "### SET: ${x}"
+               "$0" ${x}
+       done
+       ;;
+esac