How to use terminal color palette with curses

后端 未结 6 1705
名媛妹妹
名媛妹妹 2021-01-30 13:45

I can\'t get the terminal color palette to work with curses.

import curses

def main(stdscr):
    curses.use_default_colors()
    for i in range(0,7):
        st         


        
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 14:33

    I currently put these lines in front of my script.

    curses.use_default_colors()
    for i in range(0, curses.COLORS):
        curses.init_pair(i, i, -1);
    

    I don't know if it is the best solution, but at least it yields some color pairs that are consistent with the terminal color palette.

提交回复
热议问题