.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
\fBint start_color(void);\fR
.br
\fBint init_pair(short pair, short f, short b);\fR
\fBint start_color(void);\fR
.br
\fBint init_pair(short pair, short f, short b);\fR
three arguments: the number of the color-pair to be changed, the foreground
color number, and the background color number.
For portable applications:
three arguments: the number of the color-pair to be changed, the foreground
color number, and the background color number.
For portable applications:
-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
-.TP 5
--
+must be between \fB1\fR and \fBCOLOR_PAIRS\-1\fR,
+except that if default colors are used (see \fBuse_default_colors\fP)
+the upper limit is adjusted to allow for extra pairs which use
+a default color in foreground and/or background.
+.bP
The value of the second and
third arguments must be between 0 and \fBCOLORS\fR.
Color pair 0 is assumed to be white on black,
The value of the second and
third arguments must be between 0 and \fBCOLORS\fR.
Color pair 0 is assumed to be white on black,
.PP
As an extension, ncurses allows you to set color pair 0 via
the \fBassume_default_colors\fR routine, or to specify the use of
.PP
As an extension, ncurses allows you to set color pair 0 via
the \fBassume_default_colors\fR routine, or to specify the use of
\fBuse_default_colors\fR routine.
.PP
The \fBinit_color\fR routine changes the definition of a color. It takes four
\fBuse_default_colors\fR routine.
.PP
The \fBinit_color\fR routine changes the definition of a color. It takes four
given color-pair consists of. It requires three arguments: the color-pair
number, and two addresses of \fBshort\fRs for storing the foreground and the
background color numbers. The value of the first argument must be between 1
given color-pair consists of. It requires three arguments: the color-pair
number, and two addresses of \fBshort\fRs for storing the foreground and the
background color numbers. The value of the first argument must be between 1
to by the second and third arguments are between 0 and \fBCOLORS\fR.
.SS Colors
In \fB<curses.h>\fR the following macros are defined. These are the default
to by the second and third arguments are between 0 and \fBCOLORS\fR.
.SS Colors
In \fB<curses.h>\fR the following macros are defined. These are the default
Color values used in \fBinit_color\fP must be in the range 0 to 1000.
An error is returned from all functions
if the terminal has not been initialized.
An error is returned from secondary functions such as \fBinit_pair\fP
if \fBstart_color\fP was not called.
Color values used in \fBinit_color\fP must be in the range 0 to 1000.
An error is returned from all functions
if the terminal has not been initialized.
An error is returned from secondary functions such as \fBinit_pair\fP
if \fBstart_color\fP was not called.
scrolling operations, see \fBcurs_bkgd\fR(3X).
.PP
Several caveats apply on 386 and 486 machines with VGA-compatible graphics:
scrolling operations, see \fBcurs_bkgd\fR(3X).
.PP
Several caveats apply on 386 and 486 machines with VGA-compatible graphics:
COLOR_YELLOW is actually brown. To get yellow, use COLOR_YELLOW combined with
the \fBA_BOLD\fR attribute.
COLOR_YELLOW is actually brown. To get yellow, use COLOR_YELLOW combined with
the \fBA_BOLD\fR attribute.
The A_BLINK attribute should in theory cause the background to go bright. This
often fails to work, and even some cards for which it mostly works (such as the
Paradise and compatibles) do the wrong thing when you try to set a bright
"yellow" background (you get a blinking yellow foreground instead).
The A_BLINK attribute should in theory cause the background to go bright. This
often fails to work, and even some cards for which it mostly works (such as the
Paradise and compatibles) do the wrong thing when you try to set a bright
"yellow" background (you get a blinking yellow foreground instead).