cueses库函数中包含改变字体颜色的函数,可以直接调用,
下面是例程
#include <stdio.h>
#include <curses.h>
int main()
{
initscr();
move(LINES/2,COLS/2);
if(start_color() == OK)
{
init_pair(1,COLOR_RED,COLOR_BLACK);
attron(COLOR_PAIR(1));
move(LINES/2,COLS/2);
addstr("hello!");
addroff(COLOR_PAIR(1));
refresh();
}
addstr("hello!");
winend();
return 0;
}