I had a similar problem with python + curses. The solution is to enable use_default_colors and then use -1 as the background color.
This is a python example, but I hope this would be useful:
stdscr = curses.initscr() curses.start_color() curses.use_default_colors() curses.noecho() curses.cbreak() curses.init_pair(1, curses.COLOR_WHITE, -1)
idavydov
source share