From 6d99cb945368a8387ed3c4cf02e9beb7bc160411 Mon Sep 17 00:00:00 2001 From: The Magician Date: Sun, 5 Nov 2023 19:40:17 +0000 Subject: [PATCH] Add section on reset code --- thebookofcolors | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/thebookofcolors b/thebookofcolors index a9f0da6..c0b95a3 100755 --- a/thebookofcolors +++ b/thebookofcolors @@ -117,7 +117,9 @@ section_notes_on_names() { section_reset() { title "Code 0; Reset" - printf 'TODO\n' + printf "The SGR code \"0\" means \"reset\". This will restore all previously set colors and styles to the terminal's default values.\n" + printf "This is used often to end a section of styling, because codes continue indefinitely after they've been set.\n" + printf "For example, if you use \e[32m\\\e[32m to set the text to green, then that style will persist until the color is either changed again with another foreground color code, or reset with \e[0m\\\e[0m.\n" } section_bold_colors() { @@ -245,8 +247,6 @@ main() { section_credits newline - #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 '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' # @@ -262,10 +262,6 @@ main() { #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 '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'