bug-ncurses
[Top][All Lists]
Advanced

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

Re: COLORS and COLOR_PAIRS


From: Michael D. Adams
Subject: Re: COLORS and COLOR_PAIRS
Date: Sun, 16 Oct 2005 11:44:02 -0500

On 10/16/05, Thomas Dickey <address@hidden> wrote:
> 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).

That should work.  Thank you!  I am curious though why you said 17
instead of 9.  Are there other COLOR_* constants than the main 8?

Michael D. Adams
address@hidden




reply via email to

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