bug-ncurses
[Top][All Lists]
Advanced

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

Re: color_content after init_pair with -1


From: Thomas Dickey
Subject: Re: color_content after init_pair with -1
Date: Mon, 25 Sep 2006 06:49:39 -0400 (EDT)

On Sun, 24 Sep 2006, Sadrul H Chowdhury wrote:

Hi.

I am doing "init_pair(GNT_COLOR_NORMAL, -1, -1);" if "use_default_colors();"
returns OK. Now, when I want to dump the contents of the screen in HTML, I
do

/* START */
now = mvwinch(curscr, y, x);
pair_content(PAIR_NUMBER(now & A_COLOR), &fg, &bg);
color_content(fg, &r, &g, &b);
/* END */

Doing "pair_content" rightly sets fg and bg to -1 when (now & A_COLOR) is
"GNT_COLOR_NORMAL". But doing "color_content" on -1 fails to get the
appropriate RGB values. From the man-page for "color_content", I see that
the first parameter is allowed a value between 0 and COLORS. So I am
wondering whether there's a way I can get the color-contents for -1.

Not really: "-1" tells ncurses that you don't really know.
The assumed-color extension can tell it what you assume,
and given the comment here, it's likely that I didn't feed _that_ information into color_content(). But with no assumed-color,
the best that I could see for color_content() would either to return
an error, or to set r = g = b = -1;


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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