Add function that prints ANSI colour codes
This commit is contained in:
parent
c6f8269245
commit
24213efe5e
29
.config/zsh/functions/ansi-colours
Normal file
29
.config/zsh/functions/ansi-colours
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
print "\e[1;97mClassic colours:\e[0m"
|
||||
|
||||
print "Regular Bold Underline Background"
|
||||
for n in {30..37}; 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[${nbg}m\\\e[${nbg}m\e[m"
|
||||
done
|
||||
|
||||
print "\n\e[1;97mHigh intensity colours:\e[0m"
|
||||
|
||||
print "Regular Bold Underline Background"
|
||||
for n in {90..97}; do
|
||||
local nbg=$(( ${n} + 10 ))
|
||||
print -cn "\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[${nbg}m\\\e[${nbg}m\e[m"
|
||||
done
|
||||
|
||||
print "\n\e[1;97m256 colour pallette:\e[0m"
|
||||
|
||||
local -a colours
|
||||
for n in {0..255}; do
|
||||
colours+="\e[38;5;${n}m\\\e[38;5;${n}m\e[0m"
|
||||
done
|
||||
print -c ${colours}
|
||||
|
||||
print "\e[1;97mReset: \e[0m\\\e[0m"
|
Loading…
Reference in New Issue
Block a user