nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] index/RGB colors and italic/reverse/underline a


From: David Ramsey
Subject: Re: [Nano-devel] [PATCH] index/RGB colors and italic/reverse/underline attributes
Date: Tue, 27 Feb 2018 08:50:47 -0600

Testing all this with your new patch set (thanks):

Brand Huntsman:
> If you adjust the colors above 15 it would change index colors and RGB
> colors, since RGB colors just map to an index color using a lookup
> table. RGB colors are portable because #FFF maps to 7 on 8-color, 15
> on 16-color, 87 on 88-color and 255 on 256-color. Use 87 as your index
> color and you get #FFF(white) on 88-color, #5FFFFF(cyan) on 256-color
> and an error on 8/16-color terminals.

So support for only hex values for indexes is really because the hex
values are easier to translate?  (See below.)  Also, further down the
line, if enough terminals get support for 24-bit color, that should be
in #RRGGBBAA format, so it probably would have a similar mapping
downgrade on lower-color systems, right?

> These patches require a : or :namedcolor after an RGB value. Omitting
> the named color will use default color on 8/16 terminals, but the
> colon is required to make it stand out that default color will be
> used.

Okay.  Making the colon required but the named color optional is
consistent with leaving out a foreground color before the required
comma.

> The fallback attributes patch allows for "attr", "attr:" or ":attr".
> No colon means the attribute applies to all terminals, post-colon only
> applies to 88/256 terminals and pre-colon only applies to 8/16
> terminals.

Okay.  Fallbacks for attributes do make sense, seeing as they can make
things stand out when colors are inadequate.

Although all this should be mentioned in the nanorc documentation in
some form, since it is still somewhat complex (and having examples of it
definitely makes it easier to understand, at least on my end).

> Here is my nanorc for an example, it is almost stock UI on 8/16

Interesting, but it leads me to another question: how do your index/RGB
color fallbacks work in some cases?

For example, your errorcolor entry uses the hex value #b00, which in
256-color mode produces a dull red (which I'm assuming is #b00b00 or
close to it).  In 88-color mode, it produces a dull cyan instead.  I'm
guessing the latter is another case of colors' not mapping perfectly
between different color sets.

Also, here's an updated version of my .nanorc color scheme:

set errorcolor bold,brightyellow,#550000:red
set functioncolor bold,#00bbff:brightcyan
set keycolor bold,#bb00ff:brightmagenta
set numbercolor bold,#bb00ff:brightmagenta
set statuscolor bold,brightwhite,#5500bb:magenta
set selectedcolor bold,brightwhite,#0055bb:cyan
set titlecolor bold,brightwhite,#5500bb:magenta

It also has problems in 88-color mode: #550000 maps to a moderately dull
cyan, #5500bb maps to approximately green, #bb00ff maps to approximately
brightcyan, etc.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]