bug-ncurses
[Top][All Lists]
Advanced

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

Re: COLORS and COLOR_PAIRS


From: Thomas Dickey
Subject: Re: COLORS and COLOR_PAIRS
Date: Sun, 16 Oct 2005 06:59:30 -0400 (EDT)

On Sun, 16 Oct 2005, Michael D. Adams wrote:

I discovered a little annoyance while using the Python ncurses binding
so some of this may be due to that binding but I think it is true of
ncurses in general.  If I do not call use_default_colors() then COLORS
is 8 and COLOR_PAIRS is 64.  This is reasonable.  With colors 0 though
7 I can represent at most 64 pairs.  However if I do call
use_default_colors(), COLORS and COLOR_PAIRS are still 8 and 64.  This
introduces a limitation because now I can in theory represent colors
-1 though 7 for 81 pairs, but ncurses limits me to 64.  My particular
app is a text editor so I would like to provide all possible color
combinations to downstream users.  (It is very unlikely that anyone
will need all those colors at once, but I don't want to impose
arbitrary limits.)

You can make a custom terminfo that sets the pairs value to whatever you
want (though more than 17*17 would be not very useful).

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




reply via email to

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