I'm using Python curses and trying to initialize a new color using curses.init_color(). Even after initializing a new RGB value and assigning it to a pair, the changes won't take effect.
My terminal supports color change since curses.can_change_color() returns True. I've also checked the color index I changed using curses.color_content() - it returned the RGB values I specified in init_color(). I've also called curses.start_color() once at the beginning.
Am I missing something? What do I have to do to make the changes in init_color() take place? Code below:
curses.start_color()
curses.init_color(17, 200,200,200)
curses.init_pair(1, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(4, 17, curses.COLOR_BLACK)
print curses.can_change_color() #returns True
print curses.color_content(17) #(200,200,200),
stdscr.addstr("test",curses.color_pair(4)) #yet this text is blue
Am I missing something?