|
From: | bend |
Subject: | RE: Where's My Color ? HELP ! - NOW SOLVED .. .. |
Date: | Tue, 26 Nov 2013 11:02:19 -0700 |
User-agent: | Workspace Webmail 5.6.44 |
-------- Original Message --------
Subject: RE: Where's My Color ? HELP !
From: <address@hidden>
Date: Tue, November 26, 2013 8:29 am
To: address@hidden
To be clear, I even tried the wattr_set this way :wattr_set(stdscr, WA_NORMAL, COLOR_PAIR(299), NULL ) ;Ben Duncan - Business Network Solutions, Inc. 336 Elton Road Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
- Hanlon's Razor-------- Original Message --------
Subject: RE: Where's My Color ? HELP !
From: <address@hidden>
Date: Tue, November 26, 2013 8:23 am
To: address@hidden, address@hidden
Ok, changed the bottom end of the test program to:pairno = 154 ;
init_pair(pairno ,241,253);
pair_content(pairno, &pair_fg, &pair_bg ) ;
printw("PAIR CONTENT %d is fg: %d bg: %d \n", pairno, pair_fg, pair_bg) ;
pairno = 299 ;
init_pair(pairno ,241,253);
pair_content(pairno, &pair_fg, &pair_bg ) ;
printw("PAIR CONTENT %d is fg: %d bg: %d \n", pairno, pair_fg, pair_bg) ;
// for(i=0 ;i<256;i++)
for(i=0 ;i<290;i++)
{
wattron(stdscr, COLOR_PAIR(i));
printw("[COLOR %hd]", i);
}
wattr_set(stdscr, WA_NORMAL, 299, NULL ) ;
printw("[COLOR %hd]", 299);
refresh();
getch();
endwin();
return 0;
}Still no color for Pair 299.Please pray tell me what am I doing wrong and how should I be doing this.(On Ncurses 6 library)Thanks..Ben Duncan - Business Network Solutions, Inc. 336 Elton Road Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
- Hanlon's Razor-------- Original Message --------
Subject: Re: Where's My Color ?
From: Thomas Dickey <address@hidden>
Date: Mon, November 25, 2013 7:57 pm
To: address@hidden
Cc: address@hidden
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
_______________________________________________
Bug-ncurses mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-ncurses
_______________________________________________
Bug-ncurses mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-ncurses
[Prev in Thread] | Current Thread | [Next in Thread] |