bug-ncurses
[Top][All Lists]
Advanced

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

Issue using more than 256 Colors in ncurses version 6.0.20170401


From: Darby Payne
Subject: Issue using more than 256 Colors in ncurses version 6.0.20170401
Date: Wed, 26 Apr 2017 12:21:10 -0700

Hi,

Apologizes if this is the wrong place to submit bug reports. I have seen an issue with version 6.0.20170401 of ncurses where using more than 256 color pairs no longer seems to work with the macro COLOR_PAIR.

The specific line of code I was using to init the colors was

    init_pair(color, color, color);

Then to set the color

   attron(COLOR_PAIR(x));

However when using more than 256 color pairs COLOR_PAIR no longer works 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 shift. I know that there was a change to support colors and colors pairs great than 16 bits, but in this case I am only using 512 pairs. 

Thanks,
-Darby

reply via email to

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