Relative Content

Tag Archive for pythonwindowsterminalrenderingcurses

Use Custom RGB Color Pairs with Python curses

Is there any way to define custom colors in curses other than using init_color and init_pair? I’ve used custom 24-bit color codes with print() before, such as 33[38;2;{r};{g};{b}m (which sets foreground to a custom RGB color), but curses.COLORS and curses.COLOR_PAIRS restricts me to a total of 768 colors and 256 pairs when using curses.addstr.