ncurses_init_pair

(PHP 4 >= 4.1.0, PHP 5)

ncurses_init_pair -- Allocate a color pair

Description

int ncurses_init_pair ( int pair, int fg, int bg )

警告

本函数是实验性的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。

警告

本函数暂无文档,仅有参数列表。


add a note add a note User Contributed Notes
keith dot nunn at xe dot com
10-Mar-2006 10:34
Creates a reference to a pair of colors that can then be called to change the appearance of an element of the ncurses display.

The guaranteed available colors are defined as constants. See the beginning of the Ncurses section.

This is only of use if your terminal is color-enabled. See ncurses_has_colors() and ncurses_start_color().

the new display color for a character is set using ncurses_color_set();

E.g.
ncurses_start_color();
ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK);
ncurses_color_set(1); // turn the new color pair on.
// display what you want colored with this pair
ncurses_color_set(0); // return to the default color pair.

The default color pair (0) cannot be redefined.