2.7 color attributes
==================
2.7.1 Color Description
---------------
* The curses library uses the RGB method to represent a color.
* The default colors are:
Color index number
--------------- + --------
COLOR_BLACK 0
COLOR_RED 1
COLOR_GREEN 2
COLOR_YELLOW 3
COLOR_BLUE 4
COLOR_MAGENTA 5
COLOR_CYAN 6
COLOR_WHITE 7
2.7.2 color functions and variables
---------------------
Int COLORS;/** maximum number of COLORS supported by the terminal */int COLORS_PAIRS;/** maximum number of color pairs supported by the terminal */chtype COLOR_PAIR (n ); /** return the color attribute of the initialized color pair table based on the index number * // ** @ brief restores the terminal color f to the status when the terminal is opened @ return ERR terminal does not support color @ return OK success @ note generally calls initscr () the function then calls this function, which initializes the color table, And I initializes the variables COLORS and COLOR_PAIRS */int start_color (); /** @ brief change the color definition in the color pairing table entry @ param color pairing index @ param foreground color @ param background color */int init_pair (short pair, short f, short B ); /** @ brief change color definition @ param color the color defined by the change @ param r red background weight @ param B blue background weight @ param g green background weight */int init_color (short color, short r, short B, short g );
This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1286716