Add section on 8-bit color

This commit is contained in:
The Magician 2023-11-06 17:38:47 +00:00
parent 1ce29a6a3a
commit 90ca8812a2
1 changed files with 21 additions and 1 deletions

View File

@ -42,7 +42,7 @@ subtitle() {
printf "\e[4;37m" printf "\e[4;37m"
printf "$1" printf "$1"
printf "\e[0m" printf "\e[0m\n"
} }
italic() { italic() {
@ -189,7 +189,27 @@ section_8bit_colors() {
printf " for foreground colors, or " printf " for foreground colors, or "
italic "\\\e[48;5;n" italic "\\\e[48;5;n"
printf " for background colors.\n" printf " for background colors.\n"
printf "The value chosen for "
italic "n"
printf " determines which color is selected. See the information in the following two subsections to see the range of colors available.\n"
newline
subtitle "Ranges of Available Colors"
printf " 0- 7: Standard colors (the same as \\\e[30m through \\\e[37m)\n"
printf " 8- 15: Bright colors (the same as \\\e[90m through \\\e[97m)\n"
printf " 16-231: A 6x6x6 cube of RGB colors\n"
printf "232-255: Grayscale from light to dark in 24 increments\n"
newline
subtitle "A Table of Available Colors"
for i in $(seq 0 255); do
if test "$(echo $i % 8 | bc)" = "0" -a "$i" != "0"; then
printf "\n"
fi
printf "\e[38;5;${i}m\\\e[38;5;%-3d\e[0m " "$i"
done
newline
} }
section_rgb_colors() { section_rgb_colors() {