]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_color.3x.html
ncurses 6.0 - patch 20170429
[ncurses.git] / doc / html / man / curs_color.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
4   *                                                                          *
5   * Permission is hereby granted, free of charge, to any person obtaining a  *
6   * copy of this software and associated documentation files (the            *
7   * "Software"), to deal in the Software without restriction, including      *
8   * without limitation the rights to use, copy, modify, merge, publish,      *
9   * distribute, distribute with modifications, sublicense, and/or sell       *
10   * copies of the Software, and to permit persons to whom the Software is    *
11   * furnished to do so, subject to the following conditions:                 *
12   *                                                                          *
13   * The above copyright notice and this permission notice shall be included  *
14   * in all copies or substantial portions of the Software.                   *
15   *                                                                          *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23   *                                                                          *
24   * Except as contained in this notice, the name(s) of the above copyright   *
25   * holders shall not be used in advertising or otherwise to promote the     *
26   * sale, use or other dealings in this Software without prior written       *
27   * authorization.                                                           *
28   ****************************************************************************
29   * @Id: curs_color.3x,v 1.50 2017/04/01 19:57:19 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_color 3x</TITLE>
37 <link rev=made href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_color 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>                                           <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>start_color</STRONG>, <STRONG>has_colors</STRONG>, <STRONG>can_change_color</STRONG>, <STRONG>init_pair</STRONG>,
50        <STRONG>init_color</STRONG>, <STRONG>color_content</STRONG>, <STRONG>pair_content</STRONG>, <STRONG>COLOR_PAIR</STRONG>,
51        <STRONG>PAIR_NUMBER</STRONG> - <STRONG>curses</STRONG> color manipulation routines
52
53
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
56
57        <STRONG>int</STRONG> <STRONG>start_color(void);</STRONG>
58
59        <STRONG>bool</STRONG> <STRONG>has_colors(void);</STRONG>
60        <STRONG>bool</STRONG> <STRONG>can_change_color(void);</STRONG>
61
62        <STRONG>int</STRONG> <STRONG>init_pair(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>f,</STRONG> <STRONG>short</STRONG> <STRONG>b);</STRONG>
63        <STRONG>int</STRONG> <STRONG>init_color(short</STRONG> <STRONG>color,</STRONG> <STRONG>short</STRONG> <STRONG>r,</STRONG> <STRONG>short</STRONG> <STRONG>g,</STRONG> <STRONG>short</STRONG> <STRONG>b);</STRONG>
64        /* extensions */
65        <STRONG>int</STRONG> <STRONG>init_extended_pair(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>f,</STRONG> <STRONG>int</STRONG> <STRONG>b);</STRONG>
66        <STRONG>int</STRONG> <STRONG>init_extended_color(int</STRONG> <STRONG>color,</STRONG> <STRONG>int</STRONG> <STRONG>r,</STRONG> <STRONG>int</STRONG> <STRONG>g,</STRONG> <STRONG>int</STRONG> <STRONG>b);</STRONG>
67
68        <STRONG>int</STRONG>  <STRONG>color_content(short</STRONG>  <STRONG>color,</STRONG> <STRONG>short</STRONG> <STRONG>*r,</STRONG> <STRONG>short</STRONG> <STRONG>*g,</STRONG> <STRONG>short</STRONG>
69        <STRONG>*b);</STRONG>
70        <STRONG>int</STRONG> <STRONG>pair_content(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>*f,</STRONG> <STRONG>short</STRONG> <STRONG>*b);</STRONG>
71        /* extensions */
72        <STRONG>int</STRONG> <STRONG>extended_color_content(int</STRONG> <STRONG>color,</STRONG> <STRONG>int</STRONG> <STRONG>*r,</STRONG> <STRONG>int</STRONG> <STRONG>*g,</STRONG>  <STRONG>int</STRONG>
73        <STRONG>*b);</STRONG>
74        <STRONG>int</STRONG> <STRONG>extended_pair_content(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>*f,</STRONG> <STRONG>int</STRONG> <STRONG>*b);</STRONG>
75
76        <STRONG>int</STRONG> <STRONG>COLOR_PAIR(int</STRONG> <STRONG>n);</STRONG>
77        <STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM><STRONG>);</STRONG>
78
79
80 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
81
82 </PRE><H3><a name="h3-Overview">Overview</a></H3><PRE>
83        <STRONG>curses</STRONG>  supports  color  attributes on terminals with that
84        capability.  To use these  routines  <STRONG>start_color</STRONG>  must  be
85        called,  usually  right  after <STRONG>initscr</STRONG>.  Colors are always
86        used in pairs (referred to as color-pairs).  A  color-pair
87        consists  of  a  foreground  color  (for characters) and a
88        background color (for the blank field on which the charac-
89        ters  are  displayed).   A programmer initializes a color-
90        pair with the routine <STRONG>init_pair</STRONG>.  After it has  been  ini-
91        tialized, <STRONG>COLOR_PAIR</STRONG>(<EM>n</EM>) can be used to convert the pair to
92        a video attribute.
93
94        If a terminal is capable of redefining  colors,  the  pro-
95        grammer can use the routine <STRONG>init_color</STRONG> to change the defi-
96        nition  of  a  color.    The   routines   <STRONG>has_colors</STRONG>   and
97        <STRONG>can_change_color</STRONG>   return  <STRONG>TRUE</STRONG>  or  <STRONG>FALSE</STRONG>,  depending  on
98        whether the terminal has color  capabilities  and  whether
99        the  programmer  can  change the colors.  The routine <STRONG>col-</STRONG>
100        <STRONG>or_content</STRONG> allows a programmer to extract the  amounts  of
101        red,  green,  and blue components in an initialized color.
102        The routine <STRONG>pair_content</STRONG> allows a programmer to  find  out
103        how a given color-pair is currently defined.
104
105
106 </PRE><H3><a name="h3-Color-Rendering">Color Rendering</a></H3><PRE>
107        The  <STRONG>curses</STRONG>  library  combines these inputs to produce the
108        actual foreground  and  background  colors  shown  on  the
109        screen:
110
111        <STRONG>o</STRONG>   per-character video attributes (e.g., via <STRONG>waddch</STRONG>),
112
113        <STRONG>o</STRONG>   the window attribute (e.g., by <STRONG>wattrset</STRONG>), and
114
115        <STRONG>o</STRONG>   the background character (e.g., <STRONG>wbkgdset</STRONG>).
116
117        Per-character  and  window attributes are usually set by a
118        parameter containing video attributes  including  a  color
119        pair  value.  Some functions such as <STRONG>wattr_set</STRONG> use a sepa-
120        rate parameter which is the color pair number.
121
122        The background character is a special case: it includes  a
123        character value, just as if it were passed to <STRONG>waddch</STRONG>.
124
125        The <STRONG>curses</STRONG> library does the actual work of combining these
126        color pairs in an internal function called from <STRONG>waddch</STRONG>:
127
128        <STRONG>o</STRONG>   If the parameter passed to <STRONG>waddch</STRONG> is <EM>blank</EM>, and it us-
129            es the special color pair 0,
130
131            <STRONG>o</STRONG>   <STRONG>curses</STRONG> next checks the window attribute.
132
133            <STRONG>o</STRONG>   If the window attribute does not use color pair 0,
134                <STRONG>curses</STRONG> uses the color pair  from  the  window  at-
135                tribute.
136
137            <STRONG>o</STRONG>   Otherwise, <STRONG>curses</STRONG> uses the background character.
138
139        <STRONG>o</STRONG>   If  the parameter passed to <STRONG>waddch</STRONG> is <EM>not</EM> <EM>blank</EM>, or it
140            does not use the special color pair 0, <STRONG>curses</STRONG>  prefers
141            the  color  pair from the parameter, if it is nonzero.
142            Otherwise, it tries the window attribute next, and fi-
143            nally the background character.
144
145        Some  <STRONG>curses</STRONG> functions such as <STRONG>wprintw</STRONG> call <STRONG>waddch</STRONG>.  Those
146        do not combine its parameter with a  color  pair.   Conse-
147        quently  those  calls use only the window attribute or the
148        background character.
149
150
151 </PRE><H2><a name="h2-CONSTANTS">CONSTANTS</a></H2><PRE>
152        In <STRONG>&lt;curses.h&gt;</STRONG> the following macros are defined.  These are
153        the  standard colors (ISO-6429).  <STRONG>curses</STRONG> also assumes that
154        <STRONG>COLOR_BLACK</STRONG> is the default background color for all termi-
155        nals.
156
157              <STRONG>COLOR_BLACK</STRONG>
158              <STRONG>COLOR_RED</STRONG>
159              <STRONG>COLOR_GREEN</STRONG>
160              <STRONG>COLOR_YELLOW</STRONG>
161              <STRONG>COLOR_BLUE</STRONG>
162              <STRONG>COLOR_MAGENTA</STRONG>
163              <STRONG>COLOR_CYAN</STRONG>
164              <STRONG>COLOR_WHITE</STRONG>
165
166        Some terminals support more than the eight (8) "ANSI" col-
167        ors.  There are no standard  names  for  those  additional
168        colors.
169
170
171 </PRE><H2><a name="h2-VARIABLES">VARIABLES</a></H2><PRE>
172
173 </PRE><H3><a name="h3-COLORS">COLORS</a></H3><PRE>
174        is  initialized  by  <STRONG>start_color</STRONG>  to the maximum number of
175        colors the terminal can support.
176
177
178 </PRE><H3><a name="h3-COLOR_PAIRS">COLOR_PAIRS</a></H3><PRE>
179        is initialized by <STRONG>start_color</STRONG> to  the  maximum  number  of
180        color pairs the terminal can support.
181
182
183 </PRE><H2><a name="h2-FUNCTIONS">FUNCTIONS</a></H2><PRE>
184
185 </PRE><H3><a name="h3-start_color">start_color</a></H3><PRE>
186        The <STRONG>start_color</STRONG> routine requires no arguments.  It must be
187        called if the programmer wants to use colors,  and  before
188        any  other  color  manipulation  routine is called.  It is
189        good practice to call this routine  right  after  <STRONG>initscr</STRONG>.
190        <STRONG>start_color</STRONG> does this:
191
192        <STRONG>o</STRONG>   It  initializes  two global variables, <STRONG>COLORS</STRONG> and <STRONG>COL-</STRONG>
193            <STRONG>OR_PAIRS</STRONG> (respectively defining the maximum number  of
194            colors and color-pairs the terminal can support).
195
196        <STRONG>o</STRONG>   It initializes the special color pair <STRONG>0</STRONG> to the default
197            foreground and  background  colors.   No  other  color
198            pairs are initialized.
199
200        <STRONG>o</STRONG>   It  restores  the colors on the terminal to the values
201            they had when the terminal was just turned on.
202
203        <STRONG>o</STRONG>   If the terminal supports the <STRONG>initc</STRONG>  (<STRONG>initialize_color</STRONG>)
204            capability, <STRONG>start_color</STRONG> initializes its internal table
205            representing the red, green and blue components of the
206            color palette.
207
208            The components depend on whether the terminal uses CGA
209            (aka "ANSI") or HLS (i.e., the <STRONG>hls</STRONG> (<STRONG>hue_lightness_sat-</STRONG>
210            <STRONG>uration</STRONG>) capability is set).  The table is initialized
211            first for eight basic colors (black, red, green,  yel-
212            low,  blue,  magenta, cyan, and white), and after that
213            (if the terminal supports more than eight colors)  the
214            components are initialized to <STRONG>1000</STRONG>.
215
216            <STRONG>start_color</STRONG>  does  not  attempt  to set the terminal's
217            color palette to match its built-in table.  An  appli-
218            cation  may use <STRONG>init_color</STRONG> to alter the internal table
219            along with the terminal's color.
220
221        These limits apply to color values and color pairs.   Val-
222        ues  outside these limits are not legal, and may result in
223        a runtime error:
224
225        <STRONG>o</STRONG>   <STRONG>COLORS</STRONG> corresponds to the terminal database's <STRONG>max_col-</STRONG>
226            <STRONG>ors</STRONG> capability, (see <STRONG><A HREF="max_colterminfo.5.html">terminfo(5)</A></STRONG>).
227
228        <STRONG>o</STRONG>   color values are expected to be in the range <STRONG>0</STRONG> to <STRONG>COL-</STRONG>
229            <STRONG>ORS-1</STRONG>, inclusive (including <STRONG>0</STRONG> and <STRONG>COLORS-1</STRONG>).
230
231        <STRONG>o</STRONG>   a special color value <STRONG>-1</STRONG> is used in  certain  extended
232            functions  to  denote  the  <EM>default</EM> <EM>color</EM> (see <STRONG>use_de-</STRONG>
233            <STRONG>fault_colors</STRONG>).
234
235        <STRONG>o</STRONG>   <STRONG>COLOR_PAIRS</STRONG> corresponds  to  the  terminal  database's
236            <STRONG>max_pairs</STRONG> capability, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
237
238        <STRONG>o</STRONG>   legal  color  pair  values  are in the range <STRONG>1</STRONG> to <STRONG>COL-</STRONG>
239            <STRONG>OR_PAIRS-1</STRONG>, inclusive.
240
241        <STRONG>o</STRONG>   color pair <STRONG>0</STRONG> is special; it denotes "no color".
242
243            Color pair <STRONG>0</STRONG> is assumed to be white on black,  but  is
244            actually whatever the terminal implements before color
245            is initialized.  It cannot be modified by the applica-
246            tion.
247
248
249 </PRE><H3><a name="h3-has_colors">has_colors</a></H3><PRE>
250        The  <STRONG>has_colors</STRONG> routine requires no arguments.  It returns
251        <STRONG>TRUE</STRONG> if the terminal can manipulate colors; otherwise,  it
252        returns <STRONG>FALSE</STRONG>.  This routine facilitates writing terminal-
253        independent programs.  For example, a programmer  can  use
254        it  to decide whether to use color or some other video at-
255        tribute.
256
257
258 </PRE><H3><a name="h3-can_change_color">can_change_color</a></H3><PRE>
259        The <STRONG>can_change_color</STRONG> routine requires  no  arguments.   It
260        returns  <STRONG>TRUE</STRONG>  if  the  terminal  supports  colors and can
261        change their definitions; other, it returns  <STRONG>FALSE</STRONG>.   This
262        routine facilitates writing terminal-independent programs.
263
264
265 </PRE><H3><a name="h3-init_pair">init_pair</a></H3><PRE>
266        The  <STRONG>init_pair</STRONG>  routine changes the definition of a color-
267        pair.  It takes three arguments: the number of the  color-
268        pair  to  be changed, the foreground color number, and the
269        background color number.  For portable applications:
270
271        <STRONG>o</STRONG>   The first argument must be a legal color  pair  value.
272            If  default  colors  are used (see <STRONG>use_default_colors</STRONG>)
273            the upper limit is adjusted to allow for  extra  pairs
274            which  use  a default color in foreground and/or back-
275            ground.
276
277        <STRONG>o</STRONG>   The second and third arguments  must  be  legal  color
278            values.
279
280        If  the  color-pair was previously initialized, the screen
281        is refreshed and all occurrences of  that  color-pair  are
282        changed to the new definition.
283
284        As  an  extension,  ncurses allows you to set color pair <STRONG>0</STRONG>
285        via the <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG> routine, or  to  specify
286        the  use  of default colors (color number <STRONG>-1</STRONG>) if you first
287        invoke the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG> routine.
288
289
290 </PRE><H3><a name="h3-init_color">init_color</a></H3><PRE>
291        The <STRONG>init_color</STRONG> routine changes the definition of a  color.
292        It  takes  four  arguments:  the number of the color to be
293        changed followed by three RGB values (for the  amounts  of
294        red, green, and blue components).
295
296        <STRONG>o</STRONG>   The  first  argument  must be a legal color value; de-
297            fault colors are not allowed here.  (See  the  section
298            <STRONG>Colors</STRONG> for the default color index.)
299
300        <STRONG>o</STRONG>   Each  of  the  last three arguments must be a value in
301            the range <STRONG>0</STRONG> through <STRONG>1000</STRONG>.
302
303        When <STRONG>init_color</STRONG> is used, all occurrences of that color  on
304        the screen immediately change to the new definition.
305
306
307 </PRE><H3><a name="h3-color_content">color_content</a></H3><PRE>
308        The  <STRONG>color_content</STRONG> routine gives programmers a way to find
309        the intensity of the red, green, and blue (RGB) components
310        in a color.  It requires four arguments: the color number,
311        and three addresses of <STRONG>short</STRONG>s for storing the  information
312        about  the  amounts  of red, green, and blue components in
313        the given color.
314
315        <STRONG>o</STRONG>   The first argument must be a legal color value,  i.e.,
316            <STRONG>0</STRONG> through <STRONG>COLORS-1</STRONG>, inclusive.
317
318        <STRONG>o</STRONG>   The values that are stored at the addresses pointed to
319            by the last three arguments are in  the  range  <STRONG>0</STRONG>  (no
320            component) through <STRONG>1000</STRONG> (maximum amount of component),
321            inclusive.
322
323
324 </PRE><H3><a name="h3-pair_content">pair_content</a></H3><PRE>
325        The <STRONG>pair_content</STRONG> routine allows programmers  to  find  out
326        what  colors  a given color-pair consists of.  It requires
327        three arguments: the color-pair number, and two  addresses
328        of  <STRONG>short</STRONG>s  for  storing the foreground and the background
329        color numbers.
330
331        <STRONG>o</STRONG>   The first argument must be a legal color value,  i.e.,
332            in the range <STRONG>1</STRONG> through <STRONG>COLOR_PAIRS-1</STRONG>, inclusive.
333
334        <STRONG>o</STRONG>   The values that are stored at the addresses pointed to
335            by the second and third arguments are in the  range  <STRONG>0</STRONG>
336            through <STRONG>COLORS</STRONG>, inclusive.
337
338
339 </PRE><H3><a name="h3-PAIR_NUMBER">PAIR_NUMBER</a></H3><PRE>
340        <STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM>) extracts the color value from its <EM>attrs</EM>
341        parameter and returns it as a color pair number.
342
343
344 </PRE><H3><a name="h3-COLOR_PAIR">COLOR_PAIR</a></H3><PRE>
345        Its inverse <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> converts a color pair number  to
346        an  attribute.   Attributes  can  hold  color pairs in the
347        range 0 to 255.  If you need  a  color  pair  larger  than
348        that,  you must use functions such as <STRONG>attr_set</STRONG> (which pass
349        the color pair as a separate parameter)  rather  than  the
350        legacy functions such as <STRONG>attrset</STRONG>.
351
352
353 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
354        The  routines  <STRONG>can_change_color</STRONG> and <STRONG>has_colors</STRONG> return <STRONG>TRUE</STRONG>
355        or <STRONG>FALSE</STRONG>.
356
357        All other routines return the integer <STRONG>ERR</STRONG> upon failure and
358        an  <STRONG>OK</STRONG>  (SVr4  specifies only "an integer value other than
359        <STRONG>ERR</STRONG>") upon successful completion.
360
361        X/Open defines no error conditions.   This  implementation
362        will  return  <STRONG>ERR</STRONG>  on attempts to use color values outside
363        the range <STRONG>0</STRONG> to <STRONG>COLORS</STRONG>-1 (except for the default colors ex-
364        tension),  or  use color pairs outside the range <STRONG>0</STRONG> to <STRONG>COL-</STRONG>
365        <STRONG>OR_PAIRS-1</STRONG>.  Color values used in <STRONG>init_color</STRONG>  must  be  in
366        the  range <STRONG>0</STRONG> to <STRONG>1000</STRONG>.  An error is returned from all func-
367        tions if the terminal has not been initialized.  An  error
368        is  returned from secondary functions such as <STRONG>init_pair</STRONG> if
369        <STRONG>start_color</STRONG> was not called.
370
371           <STRONG>init_color</STRONG>
372                returns an error if the terminal does not  support
373                this  feature, e.g., if the <STRONG>initialize_color</STRONG> capa-
374                bility is absent from the terminal description.
375
376           <STRONG>start_color</STRONG>
377                returns an error if the color table cannot be  al-
378                located.
379
380
381 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
382        In  the  <STRONG>ncurses</STRONG> implementation, there is a separate color
383        activation flag, color palette, color pairs table, and as-
384        sociated  <STRONG>COLORS</STRONG>  and  <STRONG>COLOR_PAIRS</STRONG> counts for each screen;
385        the <STRONG>start_color</STRONG> function only affects the current  screen.
386        The SVr4/XSI interface is not really designed with this in
387        mind, and historical  implementations  may  use  a  single
388        shared color palette.
389
390        Setting  an implicit background color via a color pair af-
391        fects only character cells that a character  write  opera-
392        tion  explicitly  touches.  To change the background color
393        used when parts of a window  are  blanked  by  erasing  or
394        scrolling operations, see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
395
396        Several  caveats  apply on older x86 machines (e.g., i386,
397        i486) with VGA-compatible graphics:
398
399        <STRONG>o</STRONG>   COLOR_YELLOW is actually brown.  To  get  yellow,  use
400            COLOR_YELLOW combined with the <STRONG>A_BOLD</STRONG> attribute.
401
402        <STRONG>o</STRONG>   The A_BLINK attribute should in theory cause the back-
403            ground to go bright.  This often fails  to  work,  and
404            even some cards for which it mostly works (such as the
405            Paradise and compatibles) do the wrong thing when  you
406            try  to  set  a  bright "yellow" background (you get a
407            blinking yellow foreground instead).
408
409        <STRONG>o</STRONG>   Color RGB values are not settable.
410
411
412 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
413        This implementation satisfies XSI Curses's  minimum  maxi-
414        mums for <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG>.
415
416        The  <STRONG>init_pair</STRONG>  routine  accepts  negative values of fore-
417        ground  and  background  color  to  support  the   <STRONG>use_de-</STRONG>
418        <STRONG><A HREF="use_default_colors.3x.html">fault_colors(3x)</A></STRONG>  extension,  but only if that routine has
419        been first invoked.
420
421        The assumption that <STRONG>COLOR_BLACK</STRONG> is the default  background
422        color  for  all  terminals  can  be modified using the <STRONG>as-</STRONG>
423        <STRONG><A HREF="assume_default_colors.3x.html">sume_default_colors(3x)</A></STRONG> extension.
424
425        This implementation checks the  pointers,  e.g.,  for  the
426        values  returned  by  <STRONG>color_content</STRONG>  and <STRONG>pair_content</STRONG>, and
427        will treat those as optional parameters when null.
428
429        X/Open Curses does not specify a limit for the  number  of
430        colors and color pairs which a terminal can support.  How-
431        ever, in its use of <STRONG>short</STRONG> for the parameters,  it  carries
432        over SVr4's implementation detail for the compiled termin-
433        fo database, which uses signed 16-bit numbers.   This  im-
434        plementation provides extended versions of those functions
435        which use <STRONG>short</STRONG> parameters, allowing applications  to  use
436        larger color- and pair-numbers.
437
438
439 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
440        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,  <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,  <STRONG>curs_vari-</STRONG>
441        <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>, <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>
442
443
444
445                                                          <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
446 </PRE>
447 <div class="nav">
448 <ul>
449 <li><a href="#h2-NAME">NAME</a></li>
450 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
451 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
452 <ul>
453 <li><a href="#h3-Overview">Overview</a></li>
454 <li><a href="#h3-Color-Rendering">Color Rendering</a></li>
455 </ul>
456 </li>
457 <li><a href="#h2-CONSTANTS">CONSTANTS</a></li>
458 <li><a href="#h2-VARIABLES">VARIABLES</a>
459 <ul>
460 <li><a href="#h3-COLORS">COLORS</a></li>
461 <li><a href="#h3-COLOR_PAIRS">COLOR_PAIRS</a></li>
462 </ul>
463 </li>
464 <li><a href="#h2-FUNCTIONS">FUNCTIONS</a>
465 <ul>
466 <li><a href="#h3-start_color">start_color</a></li>
467 <li><a href="#h3-has_colors">has_colors</a></li>
468 <li><a href="#h3-can_change_color">can_change_color</a></li>
469 <li><a href="#h3-init_pair">init_pair</a></li>
470 <li><a href="#h3-init_color">init_color</a></li>
471 <li><a href="#h3-color_content">color_content</a></li>
472 <li><a href="#h3-pair_content">pair_content</a></li>
473 <li><a href="#h3-PAIR_NUMBER">PAIR_NUMBER</a></li>
474 <li><a href="#h3-COLOR_PAIR">COLOR_PAIR</a></li>
475 </ul>
476 </li>
477 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
478 <li><a href="#h2-NOTES">NOTES</a></li>
479 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
480 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
481 </ul>
482 </div>
483 </BODY>
484 </HTML>