In this simple program (written in C)
#include <ncurses.h>
#include <string.h>
int main()
{
initscr();
printw("line 1\n");
printw("line 2\n");
start_color();
init_pair(1, COLOR_RED, COLOR_BLACK);
printw("line 3");
getch();
endwin();
return 0;
}
a red text is printed on the screen over a black background. But when I run the program, the background is slightly brighter than the black background of the terminal, in Linux (Gnome terminal).
I don't want to set a background color over the default, black color of the terminal: I would like to keep the terminal background and to actually set the ncurses
background as transparent.
Is there a way to do this?
Note: I tried to put the function use_default_colors();
after start_color();
as suggested in this question, but it was not useful.