bug-ncurses
[Top][All Lists]
Advanced

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

Re: Where's My Color ?


From: Thomas Dickey
Subject: Re: Where's My Color ?
Date: Mon, 25 Nov 2013 20:57:41 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Nov 25, 2013 at 11:47:51AM -0700, address@hidden wrote:
> <html><body><span style="font-family:Verdana; color:#000000; 
> font-size:10pt;"><div>Or better yet ... why no color after pair 256 
> ?</div><div><br></div><div>Attached is sample program that shows me 256 color 
> and plus some. It sets up the</div><div>color pair. TERM is defined as 
> xterm-256color. All is well for the first 256 
> color</div><div>pair.</div><div><br></div><div>I set the 257'th (Or 256 base 
> 0) in init_mycolor () and wham. </div><div>the 256'th pair does not come out 
> as defined.</div><div><br></div><div>Is it something I am doing wrong 
> ?<br></div><div><br></div><div><span style="font-size: 8pt;" 
> mce_style="font-size: 8pt;"></span><span style="font-size: 8pt;" 
> mce_style="font-size: 8pt;">Ben Duncan - Business Network Solutions, Inc. 336 
> Elton Road  Jackson MS, 39212<br>"Never attribute to malice, that which can 
> be adequately explained by stupidity"<br>- Hanlon's 
> Razor<br></span></div></span></body></html>
> /* Test Wide Window characters for UTF-8
>  * Compile with : gcc -lncursesw -lpanelw -o testwidewin testwidewin.c
> */
...
>   for(i=0 ;i<290;i++)
>   {
>     attron(COLOR_PAIR(i));
>     printw("[COLOR %hd]", i);
>   }
> 
> 
>   attron(COLOR_PAIR(256));

Two problems:

        a) attron passes the color packed in a chtype, which limits it to 4 
bits.
        b) the "right" interface would be something like wattr_set, but unless
           you have compiled ncurses using the extended colors (or perhaps using
           the ncurses6 packages that I upload occasionally), you won't get 
that.

I covered some of that in my faq:

        http://invisible-island.net/ncurses/ncurses.faq.html#xterm_256color

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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