pair_content Subroutine

Purpose

Returns the colors in a color pair.

Library

Curses Library (libcurses.a)

Curses Syntax

#include <curses.h>

pair_content ( Pair,  F,  B)
short Pair;
short *F, *B;

Description

The pair_content subroutine returns the colors in a color pair. A color pair is made up of a foreground and background color. Call the start_color subroutine before calling the pair_content subroutine.

Note: The color pair must already be initialized before calling the pair_content subroutine.

Return Values

Table 1. Return Values
Item Description
OK The return value indicates that the subroutine was completed successfully.
ERR The return value indicates that the pair has not been initialized.

Parameters

Table 2. Parameters
Item Description
Pair Identifies the color-pair number. The Pair parameter must be between 1 and COLORS_PAIRS-1.
F Points to the address where the foreground color is stored. The F parameter is between 0 and COLORS-1.
B Points to the address where the background color is stored. The B parameter is between 0 and COLORS-1.

Example

To obtain the foreground and background colors for color-pair 5, use

short *f, *b;
pair_content(5,f,b);

For this subroutine to succeed, you must have already initialized the color pair. The foreground and background colors are stored at the locations pointed to by f and b.