.\" Copyright 2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" Copyright 2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
-.\" $Id: new_pair.3x,v 1.36 2023/09/23 22:37:46 tom Exp $
-.TH new_pair 3X 2023-09-23 "ncurses 6.4" "Library calls"
-.ie \n(.g .ds `` \(lq
-.el .ds `` ``
-.ie \n(.g .ds '' \(rq
-.el .ds '' ''
+.\" $Id: new_pair.3x,v 1.46 2024/03/16 15:35:01 tom Exp $
+.TH new_pair 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
+.ie \n(.g \{\
+.ds `` \(lq
+.ds '' \(rq
+.\}
+.el \{\
+.ie t .ds `` ``
+.el .ds `` ""
+.ie t .ds '' ''
+.el .ds '' ""
+.\}
+.
-\fBint alloc_pair(int \fIfg\fB, int \fIbg\fB);\fR
-\fBint find_pair(int \fIfg\fB, int \fIbg\fB);\fR
-\fBint free_pair(int \fIpair\fB);\fR
+\fBint alloc_pair(int \fIfg\fP, int \fIbg\fP);
+\fBint find_pair(int \fIfg\fP, int \fIbg\fP);
+\fBint free_pair(int \fIpair\fP);
on a terminal.
If the library does not keep track of the \fIcombinations\fP of
colors which are displayed, it will be inefficient.
on a terminal.
If the library does not keep track of the \fIcombinations\fP of
colors which are displayed, it will be inefficient.
For simple terminal emulators
with only a few dozen color combinations,
it is convenient to use the maximum number of combinations
as the limit on color pairs:
For simple terminal emulators
with only a few dozen color combinations,
it is convenient to use the maximum number of combinations
as the limit on color pairs:
Terminals which support \fIdefault colors\fP distinct
from \*(``ANSI colors\*(''
add to the possible combinations, producing this total:
Terminals which support \fIdefault colors\fP distinct
from \*(``ANSI colors\*(''
add to the possible combinations, producing this total:
The size of the table is determined by the terminfo \fBpairs\fP capability.
The table is shared with \fBinit_pair\fP;
in fact \fBalloc_pair\fP calls \fBinit_pair\fP after
The size of the table is determined by the terminfo \fBpairs\fP capability.
The table is shared with \fBinit_pair\fP;
in fact \fBalloc_pair\fP calls \fBinit_pair\fP after
.SS find_pair
The \fBfind_pair\fP function accepts parameters for
foreground and background color, and
.SS find_pair
The \fBfind_pair\fP function accepts parameters for
foreground and background color, and
Likewise, \fBfree_pair\fP returns \fBOK\fP unless it encounters an
error updating the fast index or if no such color pair is in use.
.SH PORTABILITY
Likewise, \fBfree_pair\fP returns \fBOK\fP unless it encounters an
error updating the fast index or if no such color pair is in use.
.SH PORTABILITY
They were not supported on
Version 7, BSD or System V implementations.
It is recommended that
any code depending on them be conditioned using \fB\%NCURSES_VERSION\fP.
They were not supported on
Version 7, BSD or System V implementations.
It is recommended that
any code depending on them be conditioned using \fB\%NCURSES_VERSION\fP.