#Colors in Ncurses.html
0. For any color operation Ästart_color()Ä must be called:
start_color();
8-bit:
For displaying 8 bit colors, Ncurses requires so called Äcolor-pairsÄ.
Color-pairs must be defined/"initialized" before usage and then must be applied as an attribute.
Each color-pair has a unique number (on conflict the newer over writes the old one)
and which is used for addressing.
1. Creating a color-pair:
{
initpair(1, COLOR_MAGENTA, COLOR_GREEN);
}
2. Turning the attibute on:
{
wattron(myWindow, COLOR_PAIR(1));
}
Now anything printed will appear with the colors set.
You can turn the attribute off similar to how you turned it on:
{
wattroff(myWindow, COLOR_PAIR(1))
}
NOTE: naming the color pair via a define or enum is recommended