bug-ncurses
[Top][All Lists]
Advanced

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

Re: Issue using more than 255 color pairs


From: David Unterwandling
Subject: Re: Issue using more than 255 color pairs
Date: Sat, 15 Jul 2023 17:31:59 +0200

> correctly. If I use a custom macro instead of COLOR_PAIR it seems to work.
> So for example
>
>     #define MY_A_COLOR NCURSES_BITS(((1U) << 16) - 1U, 0)
>     #define MY_COLOR_PAIR(n) (NCURSES_BITS((n), 0) & MY_A_COLOR)
>
> The change here is MY_A_COLOR uses a 16 bit shift instead of an 8 bit

6 years later.. I tried the same. Same result with

    #define COLOR_PAIR(n) n << 8

While that make some color pairs accessible, these are just the previously
initiated color pairs with an immutable A_REVERSE.

I checked that my distributions have built with --enable-widec, and that
NCURSES_WIDECHAR (or _XOPEN_SOURCE) is set before including curses.h.

Actually I figured out that the terminal color palette is usually 16 + 2
inclusive foreground and background.  The application uses bold for bright
on systems with less than 16 colors, so these color pairs are initiated
like regular colors.

--
David



reply via email to

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