Add table of colors with "bold" attribute

This commit is contained in:
The Magician 2023-11-04 16:45:49 +00:00
parent 3763a94363
commit be67bb14ba
1 changed files with 23 additions and 2 deletions

25
termcol
View File

@ -5,13 +5,11 @@ set -e
clear clear
printf '\e[4;37m\e[45m\e[30mA Book of Colors\e[0m\n' printf '\e[4;37m\e[45m\e[30mA Book of Colors\e[0m\n'
printf '\n' printf '\n'
printf 'Use \\e (or \\033) followed by the control sequence specified next to activate that color.\n' printf 'Use \\e (or \\033) followed by the control sequence specified next to activate that color.\n'
printf 'Use the reset sequence "[0m" to remove all set colors and styles.\n' printf 'Use the reset sequence "[0m" to remove all set colors and styles.\n'
printf 'When using these sequences in a Bash prompt (e.g. $PS1), be sure to surround the whole escape sequence with escaped brackets to prevent issues with Bash miscounting the number of characters in a line. For example: `export PS1=''\[\\e[36m\]\u@\h \$\[\\e[0m\]''` would create a cyan-colored prompt string.\n' printf 'When using these sequences in a Bash prompt (e.g. $PS1), be sure to surround the whole escape sequence with escaped brackets to prevent issues with Bash miscounting the number of characters in a line. For example: `export PS1=''\[\\e[36m\]\u@\h \$\[\\e[0m\]''` would create a cyan-colored prompt string.\n'
printf '\n' printf '\n'
printf '\e[4;37m\e[1;37mRegular Colors\e[0m\n' printf '\e[4;37m\e[1;37mRegular Colors\e[0m\n'
@ -24,3 +22,26 @@ printf '\e[34m[34m Blue\e[0m \e[44m[44m Blue\e[0m\n'
printf '\e[35m[35m Purple\e[0m \e[45m[45m Purple\e[0m\n' printf '\e[35m[35m Purple\e[0m \e[45m[45m Purple\e[0m\n'
printf '\e[36m[36m Cyan\e[0m \e[46m[46m Cyan\e[0m\n' printf '\e[36m[36m Cyan\e[0m \e[46m[46m Cyan\e[0m\n'
printf '\e[37m[37m Light grey\e[0m \e[47m[47m Light grey\e[0m\n' printf '\e[37m[37m Light grey\e[0m \e[47m[47m Light grey\e[0m\n'
printf '\n'
printf '\e[4;37m\e[1;37mExtra Attributes\e[0m\n'
printf 'Extra attributes can be given by placing a numeric value (representing the attribute) followed by a '';'' after the ''['' character.\n'
printf '\n'
printf '\e[4;37m\e[1;37m1; (Boldness)\e[0m\n'
printf '\n'
printf 'Note that some terminals use the "bold" attribute to display an alternate version of the color, e.g. a lighter or darker shade.\n'
printf 'The canonical names for these alternate colors are what is displayed below.\n'
printf 'Other terminals actually support displaying text with this attribute in a bold typeface.\n'
printf '\n'
printf '\e[4;37mForeground\e[0m \e[4;37mBackground\e[0m\n'
printf '\e[1;30m[1;30m Dark grey\e[0m \e[1;40m[1;40m Dark grey\e[0m\n'
printf '\e[1;31m[1;31m Light red\e[0m \e[1;41m[1;41m Light red\e[0m\n'
printf '\e[1;32m[1;32m Light green\e[0m \e[1;42m[1;42m Light green\e[0m\n'
printf '\e[1;33m[1;33m Yellow\e[0m \e[1;43m[1;43m Yellow\e[0m\n'
printf '\e[1;34m[1;34m Light blue\e[0m \e[1;44m[1;44m Light blue\e[0m\n'
printf '\e[1;35m[1;35m Light purple\e[0m \e[1;45m[1;45m Light purple\e[0m\n'
printf '\e[1;36m[1;36m Light cyan\e[0m \e[1;46m[1;46m Light cyan\e[0m\n'
printf '\e[1;37m[1;37m White\e[0m \e[1;47m[1;47m White\e[0m\n'