commit 9a778f9a007219ab0c8e8af54628c53759b2a5b0
parent 8d6b468cdc0ab758b38cdf736e2764e2fa82871c
Author: Brad Town <brad@bradtown.com>
Date: Sun, 21 Nov 2021 09:06:45 -0800
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>
Diffstat:
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/doc/nano.texi b/doc/nano.texi
@@ -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.
diff --git a/doc/nanorc.5 b/doc/nanorc.5
@@ -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.
diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc
@@ -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)\>"