diff --git a/thebookofcolors b/thebookofcolors index e0e7547..b88fcdb 100755 --- a/thebookofcolors +++ b/thebookofcolors @@ -42,7 +42,7 @@ subtitle() { printf "\e[4;37m" printf "$1" - printf "\e[0m" + printf "\e[0m\n" } italic() { @@ -189,7 +189,27 @@ section_8bit_colors() { printf " for foreground colors, or " italic "\\\e[48;5;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() {