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: Tue, 27 Feb 2018 02:13:55 -0700

On Mon, 26 Feb 2018 15:26:49 -0600
David Ramsey <address@hidden> wrote:

> Brand Huntsman:
> > Require a named color after every RGB value, get rid of the 8/16
> > color lookup tables. The code would much smaller and all colors
> > would be portable.  
> 
> If you go ahead and do this, I'll at least help test it.  Index colors
> that aren't portable beyond a specific palette are problematic by
> definition, especially since many X11-based terminals let you manually
> adjust their palettes anyway.

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.

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.

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.

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

# /etc/nanorc
set titlecolor bold,underline,#999:,#171717:
set numbercolor :reverse,#888:,#171717:
set selectedcolor reverse
set promptcolor bold:,reverse,#171717:,#bbb:
set statuscolor bold:,reverse,#171717:,#888:
set errorcolor bold,reverse,#b00:red,black
set keycolor bold:,reverse,#171717:,#888: 
set functioncolor #888:

# /root/.nanorc
set titlecolor bold,underline,#0bb:cyan,#171717:

Attachment: 0001-get-number-of-terminal-colors.patch
Description: Text Data

Attachment: 0002-bold-attribute-and-bright-prefix-change-v2.patch
Description: Text Data

Attachment: 0003-RGB-colors.patch
Description: Text Data

Attachment: 0004-italic-reverse-underline-attributes.patch
Description: Text Data

Attachment: 0005-fallback-attributes.patch
Description: Text Data


reply via email to

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