.\"***************************************************************************
-.\" Copyright 2018-2020,2021 Thomas E. Dickey *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey *
.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_color.3x,v 1.67 2021/12/25 17:39:16 tom Exp $
-.TH curs_color 3X ""
+.\" $Id: curs_color.3x,v 1.73 2023/07/01 14:23:04 tom Exp $
+.TH curs_color 3X 2023-07-01 "ncurses 6.4" "Library calls"
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.br
\fBbool can_change_color(void);\fP
.sp
-\fBint init_pair(short \fP\fIpair\fP\fB, short \fP\fIf\fP\fB, short \fP\fIb\fP\fB);\fP
+\fBint init_pair(short \fIpair\fB, short \fIf\fB, short \fIb\fB);\fR
.br
-\fBint init_color(short \fP\fIcolor\fP\fB, short \fP\fIr\fP\fB, short \fP\fIg\fP\fB, short \fP\fIb\fP\fB);\fP
+\fBint init_color(short \fIcolor\fB, short \fIr\fB, short \fIg\fB, short \fIb\fB);\fR
.br
/* extensions */
.br
-\fBint init_extended_pair(int \fP\fIpair\fP\fB, int \fP\fIf\fP\fB, int \fP\fIb\fP\fB);\fP
+\fBint init_extended_pair(int \fIpair\fB, int \fIf\fB, int \fIb\fB);\fR
.br
-\fBint init_extended_color(int \fP\fIcolor\fP\fB, int \fP\fIr\fP\fB, int \fP\fIg\fP\fB, int \fP\fIb\fP\fB);\fP
+\fBint init_extended_color(int \fIcolor\fB, int \fIr\fB, int \fIg\fB, int \fIb\fB);\fR
.sp
-\fBint color_content(short \fP\fIcolor\fP\fB, short *\fP\fIr\fP\fB, short *\fP\fIg\fP\fB, short *\fP\fIb\fP\fB);\fP
+\fBint color_content(short \fIcolor\fB, short *\fIr\fB, short *\fIg\fB, short *\fIb\fB);\fR
.br
-\fBint pair_content(short \fP\fIpair\fP\fB, short *\fP\fIf\fP\fB, short *\fP\fIb\fP\fB);\fP
+\fBint pair_content(short \fIpair\fB, short *\fIf\fB, short *\fIb\fB);\fR
.br
/* extensions */
.br
-\fBint extended_color_content(int \fP\fIcolor\fP\fB, int *\fP\fIr\fP\fB, int *\fP\fIg\fP\fB, int *\fP\fIb\fP\fB);\fP
+\fBint extended_color_content(int \fIcolor\fB, int *\fIr\fB, int *\fIg\fB, int *\fIb\fB);\fR
.br
-\fBint extended_pair_content(int \fP\fIpair\fP\fB, int *\fP\fIf\fP\fB, int *\fP\fIb\fP\fB);\fP
+\fBint extended_pair_content(int \fIpair\fB, int *\fIf\fB, int *\fIb\fB);\fR
.sp
/* extensions */
.br
\fBvoid reset_color_pairs(void);\fP
.sp
-\fBint COLOR_PAIR(int \fP\fIn\fP\fB);\fP
-.br
-\fBPAIR_NUMBER(\fP\fIattrs\fP\fB);\fP
+\fBint COLOR_PAIR(int \fIn\fB);\fR
.br
+\fBPAIR_NUMBER(\fIattrs\fB);\fR
.SH DESCRIPTION
.SS Overview
\fBcurses\fP supports color attributes on terminals with that capability.
Consequently those calls use only the window attribute or
the background character.
.SH CONSTANTS
-.PP
In \fB<curses.h>\fP the following macros are defined.
These are the standard colors (ISO-6429).
\fBcurses\fP also assumes that \fBCOLOR_BLACK\fP is the default
but is actually whatever the terminal implements before color is initialized.
It cannot be modified by the application.
.SS has_colors
-.PP
The \fBhas_colors\fP routine requires no arguments.
It returns \fBTRUE\fP if
the terminal can manipulate colors; otherwise, it returns \fBFALSE\fP.
For example, a programmer can use it to decide
whether to use color or some other video attribute.
.SS can_change_color
-.PP
The \fBcan_change_color\fP routine requires no arguments.
It returns \fBTRUE\fP if the terminal supports colors
and can change their definitions;
other, it returns \fBFALSE\fP.
This routine facilitates writing terminal-independent programs.
.SS init_pair
-.PP
The \fBinit_pair\fP routine changes the definition of a color-pair.
It takes three arguments:
the number of the color-pair to be changed, the foreground
default colors (color number \fB\-1\fP) if you first invoke the
\fBuse_default_colors\fP(3X) routine.
.SS init_extended_pair
-.PP
Because \fBinit_pair\fP uses signed \fBshort\fPs for its parameters,
that limits color-pairs and color-values
to 32767 on modern hardware.
for the color-pair and color-value,
allowing a larger number of colors to be supported.
.SS init_color
-.PP
The \fBinit_color\fP routine changes the definition of a color.
It takes four arguments:
the number of the color to be changed followed by three RGB values
occurrences of that color on the screen immediately change to the new
definition.
.SS init_extended_color
-.PP
Because \fBinit_color\fP uses signed \fBshort\fPs for its parameters,
that limits color-values and their red, green, and blue components
to 32767 on modern hardware.
for setting the red, green, and blue components,
allowing a larger number of colors to be supported.
.SS color_content
-.PP
The \fBcolor_content\fP routine gives programmers a way to find the intensity
of the red, green, and blue (RGB) components in a color.
It requires four arguments: the color number, and three addresses
\fB0\fP (no component) through \fB1000\fP
(maximum amount of component), inclusive.
.SS extended_color_content
-.PP
Because \fBcolor_content\fP uses signed \fBshort\fPs for its parameters,
that limits color-values and their red, green, and blue components
to 32767 on modern hardware.
for returning the red, green, and blue components,
allowing a larger number of colors to be supported.
.SS pair_content
-.PP
The \fBpair_content\fP routine allows programmers to find out what colors a
given color-pair consists of.
It requires three arguments: the color-pair
to by the second and third arguments are in the
range \fB0\fP through \fBCOLORS\fP, inclusive.
.SS extended_pair_content
-.PP
Because \fBpair_content\fP uses signed \fBshort\fPs for its parameters,
that limits color-pair and color-values to 32767 on modern hardware.
The extension \fBextended_pair_content\fP uses \fBint\fPs
for returning the foreground and background colors,
allowing a larger number of colors to be supported.
.SS reset_color_pairs
-.PP
The extension \fBreset_color_pairs\fP tells ncurses to discard all
of the color-pair information which was set with \fBinit_pair\fP.
It also touches the current- and standard-screens, allowing an application to
switch color palettes rapidly.
.SS PAIR_NUMBER
-.PP
-\fBPAIR_NUMBER(\fP\fIattrs\fP) extracts the color
+\fBPAIR_NUMBER(\fIattrs\fR) extracts the color
value from its \fIattrs\fP parameter and returns it as a color pair number.
.SS COLOR_PAIR
-Its inverse \fBCOLOR_PAIR(\fP\fIn\fP\fB)\fP converts a color pair number
+Its inverse \fBCOLOR_PAIR(\fIn\fB)\fR converts a color pair number
to an attribute.
Attributes can hold color pairs in the range 0 to 255.
If you need a color pair larger than that, you must use functions
.bP
Color RGB values are not settable.
.SH HISTORY
-.PP
SVr3.2 introduced color support to curses in 1987.
.PP
SVr4 made internal changes,
the attributes field of \fBcchar_t\fP, limiting the number of color-pairs
by the size of the bitfield.
.SH PORTABILITY
+.SS Extensions
+The functions marked as extensions were designed for \fBncurses\fP(3X),
+and are not found in SVr4 curses, 4.4BSD curses,
+or any other previous version of curses.
+.SS Standards
This implementation satisfies XSI Curses's minimum maximums
for \fBCOLORS\fP and \fBCOLOR_PAIRS\fP.
.PP