[Top][All Lists]

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

Re: [Nano-devel] [PATCH] bright colors without bold

From: Brand Huntsman
Subject: Re: [Nano-devel] [PATCH] bright colors without bold
Date: Sat, 27 Jan 2018 16:31:50 -0700

On Sat, 27 Jan 2018 13:51:06 +0100
Benno Schulenberg <address@hidden> wrote:

> > That is a terrible idea. Everything would be clamped to white and
> > would be unreadable on a white background.  
> ??  No, only the indexes 0-15 would get reduced to 0-7.  Anything
> above 15... I don't know.

If index is 8-15 it could subtract 8 and set bright flag to true. 
parse_color_names() could then re-add the 8 or A_BOLD it if only 8 colors. This 
would need to be in a sixth patch, or rolled into the bright patch, after the 
bright patch is resolved.

But any indices above 15 that are also greater than nr_term_colors should 
return -1 and cause the regex to be ignored.

> Okay.  So the "bright" prefix has to continue to mean A_BOLD, only the
> "bright" attribute should mean just bright.

A bright attribute complicates the code because it can only work with color 
names. color_to_short() would need a third flag: bold flag is set for bright 
prefix, bright flag is set for 8-15 index colors and cname flag is set if a 
color name. Then parse_color_names() needs an attr_bright flag and must handle 
four flags instead of two, and the mixture of error messages that could occur.

And you get colors that look like this:

bright,red -- bright
brightred -- bold
bold,red -- bold

Difference between bright and bold is a single comma.

reply via email to

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