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: Brand Huntsman
Subject: Re: [Nano-devel] [PATCH] index/RGB colors and italic/reverse/underline attributes
Date: Sun, 18 Feb 2018 18:00:21 -0700

On Sun, 18 Feb 2018 14:39:54 -0600
David Ramsey <address@hidden> wrote:

> set numbercolor bold,#a000f0
> set titlecolor bold,brightwhite,#5000a0
> 
> Now, if $TERM is set wrongly, so that 256-color support isn't enabled,
> the colors obviously won't work (specifically, the first color scheme
> happens to map the extended colors to rather similar shades of blue).
> Are there any eventual plans to specify non-extended fallback colors
> in that case, or display a minor warning that some colors won't be
> available?

I posted a text file with the first round of patches and have attached it here 
for convenience. Should this content be in a/the man page?

There are only 4 color shades per channel on 88-color and 6 color shades on 
256-color. Any color you plan on distributing should only use those 4-6 shades, 
or you risk it not mapping properly between 88 and 256 terminals. Grayscale 
colors have many more cases and that file documents the most portable.

You can use any RGB color you want, but it will always be mapped to what the 
terminal supports. Your 50 and F0 are mapped to 55 and FF on 88 and 256 color 
terminals. But your A0 is mapped to BB on 256-color and to 55 on 88-color. 
Using BB would produce more similar colors on both terminals. But keep in mind, 
the shade used on 88 or 256 is not actually 55, 77, BB or CC. Those are simply 
single-digit values I chose to most represent the shade across 88/256 terminals.

Mapping to 8/16 color is a gamble because those colors are usually redefined by 
the OS/distro, terminal or user. The brightwhite in your example might not 
actually be pure bright white. Using #FFF or #FFFFFF on 88/256-color terminals 
will use a code other than 15 which should always be pure bright white, unless 
the user changed the extended colors too. So mixing named colors and RGB colors 
will not produce the same theme across systems.

We could support a fallback color for index and rgb colors.
# index:namedcolor
# #rgb:namedcolor
set titlecolor bold,#FFF:brightwhite,#50A:magenta

On 8/16-color terminals it would use the named color, if given. But you would 
still need to use semi-portable colors for 88/256. Extending it to provide a 
color for every terminal type could get verbose, especially down the road when 
ncurses gets 24bit support.

# 24bit:256:88:8/16
set titlecolor #FEFEFE:#FFF:#FFF:brightwhite

Thoughts?

Attachment: rgb-colors
Description: Binary data


reply via email to

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