tags:

views:

86

answers:

1

I am trying to get the background the standard terminal color instead of black but I can't seem to figure it out. When I use use_default_colors() the standards is just like not using colors but I would like to change the foreground color and not the background color. I use init_color_pair(1, COLOR_RED, COLOR_BLACK); but that gives me a black background, what I don't want.

+1  A: 

in order to have transparent background, the user of your app should have specified it in their .Xdefaults or something similar. If the user already has a transparent background, all you have to do, is to use the default background like so:

use Curses;
#...some init here...
# colors:
use_default_colors;  # mandatory, we want to use the default background which is transparent
init_pair 1, COLOR_BLUE, -1;  # -1 mandatory, again, we want *default* background
init_pair 2, -1, COLOR_WHITE;  # you can use the default foreground color if you like
fengshaun
I just needed to know -1 was default. Thank you very very much.
vincentkriek