Home > PHP > Function > Ncurses > ncurses_init_pair()

ncurses_init_pair()

ncurses_init_pair - Define a color pair

Syntax

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

Arguments

  • pair - The number of the color pair to define.
  • fg - The foreground color for the color pair. May be one of the pre-defined colorsor one defined by ncurses_init_color() if the terminal has color changing capabilities.
  • bg - The background color for the color pair. May be one of the pre-defined colorsor one defined by ncurses_init_color() if the terminal has color changing capabilities.

Description

Defines or redefines the given color pair to have the given foreground and background colors. If the color pair was previously initialized, the screen is refreshed and all occurrences of it are changed to reflect the new definition.

Version

PHP 4.0.7, 5 < 5.3.0, PECL ncurses >= 1.0.0

Return value

Returns -1if the function was successful, and 0if ncurses or color support were not initialized.