Defining a new color in ncurses

后端 未结 1 689
-上瘾入骨i
-上瘾入骨i 2021-01-14 06:34

I am trying to learn ncurses and was wondering if I can create my own custom colors. I am aware that by using init_color(), I can modify any pre-defined colors

相关标签:
1条回答
  • 2021-01-14 06:44

    init_color() is the only way to define new colors but the number of colors and color pairs available depends on the terminal you are using.

    Many terminals can support up to 256 colors but on most systems the default TERM value is xterm which only supports 8. xterm can be compiled with 256 color support and I think gnome-terminal supports 256. Try changing your TERM enviroment variable to xterm-256color and check the COLORS variable in your ncurses program.

    0 讨论(0)
提交回复
热议问题