[Top][All Lists]

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

init_color() problem

From: Simon Sasburg
Subject: init_color() problem
Date: Wed, 15 Nov 2006 18:58:16 +0100

I recently started fiddling around with ncurses to see if i could use it to port an MSDOS app of mine to linux.

After finding out I could use A_BOLD to access all 16 colors instead of just 8, i started looking how i could change the palette.

I found init_color() and it seemed to work fine... for the first 8 colors.

After a bit of poking around i found that the following could be used to change colors 8-15:

    COLORS = 16; // was 8 originally
    init_color(COLOR_BLUE + 8, 0, 999, 0); // this sets "bold" blue to rgb 00FF00

Now, obviously this is a bit of a hack, and init_color() uses its first parameter as an index into some array, so it may even cause buffer overflows or similar nastyness.

But, it does work, so the terminal does support changing the rgb values of the "bold" colors...

I shouldn't really have to use such a hack to make ncurses let me do this, i think.

Any thoughts on this?

reply via email to

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