I would like to be able to print text with foreground/background colors swapped, like for example, the top bar in nano
. But I want to use the default terminal colors. I am already calling use_default_colors()
. Calling pair_content(0, &c1, &c2)
just gives me c1=-1, c2=-1
, so I don't have any values to pass in to init_pair()
, since -1 means both default foreground and background color. How can I swap those colors in another color pair, or how can I get default foreground/background color rgb values so I can reinitialize some colors to be the default terminal foreground and background colors?
Asked
Active
Viewed 305 times
0

Arthur Bouvier
- 89
- 11
1 Answers
1
short: color pairs don't do that.
longer: you could apply the attribute for reverse-video A_REVERSE
, but it's not a color. It gets passed around as easily as color pairs.

Thomas Dickey
- 51,086
- 7
- 70
- 105