From ee33e47455209b164938bf2f2cd93ce8882f4fac Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 15 Feb 2013 17:54:14 -0500 Subject: [PATCH] add 256 colors --- .bin/bash-colors | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.bin/bash-colors b/.bin/bash-colors index 04c6376..d7076fa 100755 --- a/.bin/bash-colors +++ b/.bin/bash-colors @@ -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 -- 2.39.5