uploaded colo.sh

simple color test of the most basic colors + bold/bright + dim variants
This commit is contained in:
jan6 2019-04-06 10:58:24 -04:00
parent edd73275b1
commit be8dbd51e8
1 changed files with 56 additions and 0 deletions

56
colo.sh Normal file
View File

@ -0,0 +1,56 @@
#!/bin/bash
echoe="e" # "echo" in (d)ash does not have -e option, instead enables it by default, this is why it's here,
# though now it is using arrays n stuff so not dash-compatible anyway
#V="┃";H="━";
#TopLeft="┏";TopRight="┓";
#MiddleLeft="┣";MiddleRight="┫";
#BottomLeft="┗";BottomRight="┛";
#TX="┳";MX="╋";BX="┻"
arr=(\
"┃" "━" \
"┏" "┳" "┓" \
"┣" "╋" "┫" \
"┗" "┻" "┛" )
arr_i=0;for i in $(echo "V H TopLeft TX TopRight MiddleLeft MX MiddleRight BottomLeft BX BottomRight");do
export $i=${arr[$arr_i]};arr_i=$((arr_i+1)) #export cause just $i will result in "command not found"
done
x-line() {
for i in $(seq 2) "";do
for j in $(seq 13);do
echo -n "$H";
done;
if [[ "$i" -ne "" ]];then #else there's one extra joint that is hard to deal with
case "$1" in
"top") echo -n "${TX}${H}";;
"middle") echo -n "${MX}${H}";;
"bottom") echo -n "${BX}${H}";;
*) echo -n "?${H}";;
esac
fi;
done;}
echo -n "$TopLeft";
x-line top;
echo "$TopRight";
echo "$V normal $V light $V dark $V"
echo -n "$MiddleLeft";
x-line middle;
echo "$MiddleRight";
i=0;for i in $(seq 0 7);do
echo -n "$V";
for x in "" 1 2;do
for j in 3 4 "7;3" "7;4";do
echo -n${echoe} " \033[${x};${j}${i}m##\033[0m";
done;echo -n " $V ";
done;echo;
done;
echo -n "$BottomLeft";
x-line bottom
echo -n "$BottomRight";
echo