]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_color.3x
ncurses 5.3
[ncurses.git] / man / curs_color.3x
index 271c5dcd53b26bf34ea8261ca5c518597bbf346a..18926d92e6c16d97eae443d846d0d5f15b7df537 100644 (file)
@@ -1,10 +1,42 @@
-.\" $Id: curs_color.3x,v 1.9 1997/12/06 22:06:00 tom Exp $
+.\"***************************************************************************
+.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc.              *
+.\"                                                                          *
+.\" Permission is hereby granted, free of charge, to any person obtaining a  *
+.\" copy of this software and associated documentation files (the            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: curs_color.3x,v 1.19 2002/02/16 22:38:32 tom Exp $
 .TH curs_color 3X ""
 .SH NAME
-\fBstart_color\fR, \fBinit_pair\fR,
-\fBinit_color\fR, \fBhas_colors\fR, \fBcan_change_color\fR,
-\fBcolor_content\fR, \fBpair_content\fR - \fBcurses\fR color
-manipulation routines
+\fBstart_color\fR,
+\fBinit_pair\fR,
+\fBinit_color\fR,
+\fBhas_colors\fR,
+\fBcan_change_color\fR,
+\fBcolor_content\fR,
+\fBpair_content\fR,
+\fBCOLOR_PAIR\fR - \fBcurses\fR color manipulation routines
 .SH SYNOPSIS
 \fB# include <curses.h>\fR
 .br
@@ -55,12 +87,26 @@ just turned on.
 
 The \fBinit_pair\fR routine changes the definition of a color-pair.  It takes
 three arguments: the number of the color-pair to be changed, the foreground
-color number, and the background color number.  The value of the first argument
-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.  The value of the second and
+color number, and the background color number.
+For portable applications:
+.TP 5
+-
+The value of the first argument
+must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
+.TP 5
+-
+The value of the second and
 third arguments must be between 0 and \fBCOLORS\fR (the 0 color pair is wired
-to white on black and cannot be changed).  If the color-pair was previously
-initialized, the screen is refreshed and all occurrences of that color-pair is
-changed to the new definition.
+to white on black and cannot be changed).
+.PP
+If the color-pair was previously
+initialized, the screen is refreshed and all occurrences of that color-pair
+are changed to the new definition.
+
+As an extension, ncurses allows you to set color pair 0 via
+the \fBassume_default_colors\fR routine, or to specify the use of
+default colors (color number \fB-1\fR) if you first invoke the
+\fBuse_default_colors\fR routine.
 
 The \fBinit_color\fR routine changes the definition of a color.  It takes four
 arguments: the number of the color to be changed followed by three RGB values
@@ -132,15 +178,18 @@ the background color used when parts of a window are blanked by erasing or
 scrolling operations, see \fBcurs_bkgd\fR(3X).
 
 Several caveats apply on 386 and 486 machines with VGA-compatible graphics:
-
+.TP 5
+-
 COLOR_YELLOW is actually brown.  To get yellow, use COLOR_YELLOW combined with
 the \fBA_BOLD\fR attribute.
-
+.TP 5
+-
 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).
-
+.TP 5
+-
 Color RGB values are not settable.
 .SH PORTABILITY
 This implementation satisfies XSI Curses's minimum maximums
@@ -149,11 +198,16 @@ for \fBCOLORS\fR and \fBCOLOR_PAIRS\fR.
 The \fBinit_pair\fP routine accepts negative values of foreground
 and background color to support the \fBuse_default_colors\fP extension,
 but only if that routine has been first invoked.
+.PP
+The assumption that \fBCOLOR_BLACK\fR is the default
+background color for all terminals can be modified using the
+\fBassume_default_colors\fP extension,
+
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_initscr\fR(3X),
 \fBcurs_attr\fR(3X),
-\fBdft_fgbg\fR(3X)
+\fBdefault_colors\fR(3X)
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables: