1
0
Fork 0

ansi-color: Inform about the background option textually

This commit is contained in:
tastytea 2022-03-19 09:12:50 +01:00
parent df0c96d8bc
commit 3c799ae129
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 7 additions and 7 deletions

View File

@ -10,14 +10,12 @@ function _ansi-colors_8()
local start="${2}"
print "\e[1;97m${title}:\e[0m"
print "Regular Bold Underline Italic Crossed Dim Blinking Reversed Background"
print "Regular Bold Underline Italic Crossed Dim Blinking Reversed"
for n in {${start}..$(( ${start}+7 ))}; do
local nbg=$(( ${n}+10 ))
print -c "\e[0;${n}m\\\e[0;${n}m\e[m" "\e[1;${n}m\\\e[1;${n}m\e[m" \
"\e[4;${n}m\\\e[4;${n}m\e[m" "\e[3;${n}m\\\e[3;${n}m\e[m" \
"\e[9;${n}m\\\e[9;${n}m\e[m" "\e[2;${n}m\\\e[2;${n}m\e[m" \
"\e[5;${n}m\\\e[5;${n}m\e[m" \
"\e[7;${n}m\\\e[7;${n}m\e[m" "\e[${nbg}m\\\e[${nbg}m\e[m"
"\e[5;${n}m\\\e[5;${n}m\e[m" "\e[7;${n}m\\\e[7;${n}m\e[m"
done
}
@ -35,14 +33,16 @@ function _ansi-colors_256()
done
print -C 6 -a ${colours}
print "\n\e[1;97m256 colour background:\e[0m 48 instead of 38"
print "\e[1;97mTrue colour:\e[0m \\\e[38;2;\e[0;31mR\e[0m;\e[0;32mG\e[0m;\e[0;34mB\e[0mm" \
print "\e[1;97mBackground:\e[0m 48 instead of 38"
print "\n\e[1;97mTrue colour:\e[0m \\\e[38;2;\e[0;31mR\e[0m;\e[0;32mG\e[0m;\e[0;34mB\e[0mm" \
"and \\\e[48;2;\e[0;41mR\e[0m;\e[0;42mG\e[0m;\e[0;44mB\e[0mm"
}
_ansi-colors_8 "Classic colours" 30
print
print "\e[1;97mBackground:\e[0m 40-47 instead of to 30-37\n"
_ansi-colors_8 "High intensity colours" 90
print "\e[1;97mBackground:\e[0m 100-107 instead of 90-97"
[[ -v 1 && "${1[1]}" == "8" ]] || _ansi-colors_256