My console has transparency enabled, when I run other ncurses apps, I see the the background stays transparent. I'm trying to make my app keep the transparency and not apply a dark black opaque background.
This is what I'm doing so far
start_color();
init_pair(1, COLOR_GREEN, COLOR_BLACK);
attron(COLOR_PAIR(1));
mvprintw(10,10, "Hello");
refresh();
attroff(COLOR_PAIR(1));
Any ideas?
Thanks
If your application calls use_default_colors
, ncurses (and NetBSD curses) provide an extension based on ECMA-48 SGR 39 and 49 "default colors". When you do this, ncurses refrains from explicitly coloring cells whose foreground and/or background color match its assumption about the terminal colors.
There is an additional function assume_default_colors
which can be used to improve the default-colors feature where the terminal is (for example) using black text on a white background.
Most of the color-capable terminals you use support the SGR 39/49 codes, so the feature can be used most of the time.
Further reading:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With