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: Sun, 16 Jul 2023 00:06:31 +0200

In-Reply-To: <ZLK77gvDufh2Rwhb@prl-debianold-64.jexium-island.net>
References: <ZLK77xDE6pSvXDCB@scw>
 <ZLK77gvDufh2Rwhb@prl-debianold-64.jexium-island.net>


> perhaps if you provided a complete test-program which demonstrates an
> unwanted change, I could investigate that.

#define _XOPEN_SOURCE 700
#include <curses.h>
#include <string.h>

void main(void)
{   
    register int i;
    char *f, *s;

    initscr();
    start_color();
    use_default_colors();
    
    sprintf(f, "%d color pairs allowed", COLOR_PAIRS); /* 65536 */
    s = strdup(f);
    addstr(s);
    
    for (i = 1; i < 300; i++)
        init_pair(i, -1, COLOR_RED);

    if (!COLOR_PAIR(256))
        addstr(", but maximum is 256\n");

#define A_COLOR NCURSES_BITS(((1U) << 16) - 1U, 0)

    attron(COLOR_PAIR(260));
    addstr("now these are immutable and have A_REVERSE");
    
    refresh();
    getch();
    endwin();
}



reply via email to

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