[Top][All Lists]

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

Obtaining and setting RGB values

From: Markus Mottl
Subject: Obtaining and setting RGB values
Date: Wed, 28 Oct 2009 15:42:00 -0400
User-agent: Mutt/1.5.18 (2008-05-17)


we are a little confused about the behavior of ncurses wrt. obtaining
and setting RGB values when the terminal supports 256 colors.

The function color_content returns bogus patterns for any color larger
than the standard eight system colors.  This is obviously intended by
the implementation, but we are not sure why, since we do not know much
about low-level terminal stuff.  Maybe it's impossible to query terminals
for these values?

This problem wouldn't be too bad if we could just enforce a set
of RGB-values.  Sadly, even though ncurses reports that setting of
RGB-values is supported, there seems to be no effect when doing so.

Your "ncurses" test application also fails at the above.  The only
workaround for these problems we have found so far is to implement
an algorithm that computes the RGB-values associated with the "color
cubes" and gray scale ramp for 256 colors (tested successfully with
gnome-terminal and xterm), and to map user-supplied RGB-values to the
closest available match using some color distance heuristics.

It also seems that the number of supported color pairs is smaller than
reported by ncurses (256 (?) instead of 32768).

We have tried the newest ncurses release, compiled it with the required
flags for supporting 256 colors, used different terminals under Linux
and Mac OS X (xterm, gnome-terminal, rxvt, iTerm) with different
TERM-settings, etc., but querying and setting colors is obviously
impossible in any configuration.

Maybe we are just mistaken about the state of 256 color support in
ncurses.  Could you please explain whether these are known issues or
whether there is anything we could try to improve this situation?  Thanks!

Best regards,

Markus Mottl     Jane St. Capital, LLC     address@hidden

reply via email to

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