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.
views:
86answers:
1
+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
2010-07-13 03:09:55
I just needed to know -1 was default. Thank you very very much.
vincentkriek
2010-07-21 11:52:05