docs: add a description of the hexadecimal #rgb color specification

Also, update the syntax to colorize these codes the same as color names.

Signed-off-by: Brad Town <brad@bradtown.com>
This commit is contained in:
Brad Town 2021-11-21 09:06:45 -08:00 committed by Benno Schulenberg
parent 8d6b468cdc
commit 9a778f9a00
3 changed files with 21 additions and 1 deletions

View File

@ -925,6 +925,11 @@ other valid (but unprefixable) color names are:
@code{lagoon}, @code{mint}, @code{lime},
@code{peach}, @code{orange}, @code{latte}, and @code{normal}
--- where @code{normal} means the default foreground or background color.
On such emulators, the color may also be specified as a three-digit hexadecimal
number prefixed with @code{#}, with the digits representing the amounts of red,
green, and blue, respectively. This tells @command{nano} to select from the
available palette the color that approximates the given values.
Either @var{fgcolor} or ,@var{bgcolor} may be left out,
and the pair may be preceded by @code{bold} and/or @code{italic}
(separated by commas) to get a bold and/or slanting typeface,
@ -1262,6 +1267,11 @@ other valid (but unprefixable) color names are:
@code{lagoon}, @code{mint}, @code{lime},
@code{peach}, @code{orange}, @code{latte}, and @code{normal}
--- where @code{normal} means the default foreground or background color.
On such emulators, the color may also be specified as a three-digit hexadecimal
number prefixed with @code{#}, with the digits representing the amounts of red,
green, and blue, respectively. This tells @command{nano} to select from the
available palette the color that approximates the given values.
The color pair may be preceded by @code{bold} and/or @code{italic}
(separated by commas) to get a bold and/or slanting typeface,
if your terminal can do those.

View File

@ -365,6 +365,11 @@ other valid (but unprefixable) color names are:
.BR pink ", " purple ", " mauve ", " lagoon ", " mint ", "
.BR lime ", " peach ", " orange ", " latte ", and " normal
-- where \fBnormal\fR means the default foreground or background color.
On such emulators, the color may also be specified as a three-digit hexadecimal
number prefixed with \fB#\fR, with the digits representing the amounts of red,
green, and blue, respectively. This tells \fBnano\fR to select from the
available palette the color that approximates the given values.
Either "\fIfgcolor\fR" or "\fB,\fIbgcolor\fR" may be left out,
and the pair may be preceded by \fBbold\fR and/or \fBitalic\fR
(separated by commas) to get a bold and/or slanting typeface,
@ -498,6 +503,11 @@ other valid (but unprefixable) color names are:
.BR pink ", " purple ", " mauve ", " lagoon ", " mint ", "
.BR lime ", " peach ", " orange ", " latte ", and " normal
-- where \fBnormal\fR means the default foreground or background color.
On such emulators, the color may also be specified as a three-digit hexadecimal
number prefixed with \fB#\fR, with the digits representing the amounts of red,
green, and blue, respectively. This tells \fBnano\fR to select from the
available palette the color that approximates the given values.
The color pair may be preceded by \fBbold\fR and/or \fBitalic\fR
(separated by commas) to get a bold and/or slanting typeface,
if your terminal can do those.

View File

@ -7,7 +7,7 @@ comment "#"
color brightred ".*"
# Color names
color yellow "^[[:blank:]]*(i?color|set[[:blank:]]+((error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color))[[:blank:]]+(bold,)?(italic,)?(((bright|light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|grey|gray)?(,(((light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|grey|gray))?\>"
color yellow "^[[:blank:]]*(i?color|set[[:blank:]]+((error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color))[[:blank:]]+(bold,)?(italic,)?(((bright|light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|grey|gray|#[[:xdigit:]]{3})?(,(((light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|grey|gray|#[[:xdigit:]]{3}))?\>"
# Keywords
color brightgreen "^[[:blank:]]*(set|unset)[[:blank:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|tabstospaces|trimblanks|unix|wordbounds|zap|zero)\>"