Home > PHP > Function > Ncurses > ncurses_pair_content()

ncurses_pair_content()

ncurses_pair_content - Retrieves foreground and background colors of a color pair

Syntax

int ncurses_pair_content (int $pair, int &$f, int &$b)

Arguments

  • pair - The number of the color pair to retrieve information for.
  • f - A reference to which to return the foreground color of the color pair. The information returned will be a color number referring to one of the pre-defined colorsor a color defined previously by ncurses_init_color() if the terminal supports color changing.
  • b - A reference to which to return the background color of the color pair. The information returned will be a color number referring to one of the pre-defined colorsor a color defined previously by ncurses_init_color() if the terminal supports color changing.

Description

Retrieves the foreground and background colors that constitute the given color pair. Terminal color capabilities must be initialized with ncurses_start_color() prior to calling this function.

Version

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

Return value

Returns -1if the function was successful, and 0if ncurses or terminal color capabilities have not been initialized.