Added short version of color test function (less verbose).

This commit is contained in:
Stefan Gaiselmann 2021-02-03 15:31:31 +01:00
parent 0dfb90b672
commit 82393a324e

View File

@ -5,9 +5,10 @@
# and/or modify it under the terms of the Do What The Fuck You Want # and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See # To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details. # http://sam.zoy.org/wtfpl/COPYING for more details.
function printFullColors() {
#Background #Background
for clbg in {40..47} {100..107} 49 ; do for clbg in {40..47} {100..107} 49 ; do
#Foreground #Foreground
for clfg in {30..37} {90..97} 39 ; do for clfg in {30..37} {90..97} 39 ; do
#Formatting #Formatting
@ -17,8 +18,28 @@ for clbg in {40..47} {100..107} 49 ; do
done done
echo #Newline echo #Newline
done done
done done
}
# See https://askubuntu.com/questions/27314/script-to-display-all-terminal-colors
function printShortColors() {
for x in {0..8}; do
for i in {30..37}; do
for a in {40..47}; do
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
done
echo
done
done
echo ""
}
if [ "$1" == "--full" ]; then
printFullColors
else
printShortColors
fi
exit 0 exit 0