Using curses in python you can easily use the default color scheme for the terminal using:
curses.use_default_colors()
However once you try to recolor any character, using a color pair you have to declare a background color:
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
I really don't want to change the background from the default but I would like to change the foreground.
Is there any way to either get the default background color? or to change just the foreground color?
I am aware that I could use ANSI escape codes to adjust just the foreground color, however ANSI codes are not compatible with curses and I would rather work with curses than rewrite everything in ANSI codes.

所有评论(0)