1、初始化颜色
//init_pair(short index,short foreground,short background)初始化颜色索引
//attron(COLOR_PAIR(索引号)|属性)
属性如下:
??? ?A_NORMAL? ?? ?? ?Normal display (no highlight)
? ???A_STANDOUT? ?? ? Best highlighting mode of the terminal.亮色
? ???A_UNDERLINE? ?? ?Underlining
? ???A_REVERSE? ?? ???Reverse video
? ???A_BLINK? ?? ?? ? Blinking闪烁
? ???A_DIM? ?? ?? ?? ?Half bright半亮度
? ???A_BOLD? ?? ?? ???Extra bright or bold高亮度
? ???A_PROTECT? ?? ???Protected mode
? ???A_INVIS? ?? ?? ? Invisible or blank mode
? ???A_ALTCHARSET? ???Alternate character set另类字符集
? ???A_CHARTEXT? ?? ? Bit-mask to extract a character
2、编译:
1)必须安装cursesew库
sudo apt-get install libncursesw5-dbg libncursesw5-dev
2)编译