4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>default_colors</B>: <B>use_default_colors</B>, <B>assume_default_colors</B>
9 - use terminal's default colors
13 <H2>SYNOPSIS</H2><PRE>
14 <B>#include</B> <B><curses.h></B>
16 <B>int</B> <B>use_default_colors(void);</B>
17 <B>int</B> <B>assume_default_colors(int</B> <B>fg,</B> <B>int</B> <B>bg);</B>
21 <H2>DESCRIPTION</H2><PRE>
22 The <I>use</I><B>_</B><I>default</I><B>_</B><I>colors()</I> and <I>assume</I><B>_</B><I>default</I><B>_</B><I>colors()</I> func-
23 tions are extensions to the curses library. They are used
24 with terminals that support ISO 6429 color, or equivalent.
25 These terminals allow the application to reset color to an
26 unspecified default value (e.g., with SGR 39 or SGR 49).
28 Applications that paint a colored background over the
29 whole screen do not take advantage of SGR 39 and SGR 49.
30 Some applications are designed to work with the default
31 background, using colors only for text. For example,
32 there are several implementations of the <B>ls</B> program which
33 use colors to denote different file types or permissions.
34 These "color ls" programs do not necessarily modify the
35 background color, typically using only the <I>setaf</I> terminfo
36 capability to set the foreground color. Full-screen
37 applications that use default colors can achieve similar
40 The first function, <I>use</I><B>_</B><I>default</I><B>_</B><I>colors()</I> tells the curses
41 library to assign terminal default foreground/background
42 colors to color number -1. So init_pair(x,COLOR_RED,-1)
43 will initialize pair x as red on default background and
44 init_pair(x,-1,COLOR_BLUE) will initialize pair x as
45 default foreground on blue.
47 The other, <I>assume</I><B>_</B><I>default</I><B>_</B><I>colors()</I> is a refinement which
48 tells which colors to paint for color pair 0. This func-
49 tion recognizes a special color number -1, which denotes
50 the default terminal color.
52 The following are equivalent:
53 <I>use</I><B>_</B><I>default</I><B>_</B><I>colors();</I>
54 <I>assume</I><B>_</B><I>default</I><B>_</B><I>colors(-1,-1);</I>
56 These are ncurses extensions. For other curses implemen-
57 tations, color number -1 does not mean anything, just as
58 for ncurses before a successful call of <I>use</I><B>_</B><I>default</I><B>_</B><I>col-</I>
59 <I>ors()</I> or <I>assume</I><B>_</B><I>default</I><B>_</B><I>colors()</I>.
61 Other curses implementations do not allow an application
62 to modify color pair 0. They assume that the background
63 is COLOR_BLACK, but do not ensure that the color pair 0 is
64 painted to match the assumption. If your application does
65 not use either <I>use</I><B>_</B><I>default</I><B>_</B><I>colors()</I> or <I>assume</I><B>_</B><I>default</I><B>_</B><I>col-</I>
66 <I>ors()</I> ncurses will paint a white foreground (text) with
67 black background for color pair 0.
71 <H2>RETURN VALUE</H2><PRE>
72 These functions return the integer <B>ERR</B> upon failure and <B>OK</B>
73 on success. They will fail if either the terminal does
74 not support the <I>orig</I><B>_</B><I>pair</I> or <I>orig</I><B>_</B><I>colors</I> capability. If
75 the <I>initialize</I><B>_</B><I>pair</I> capability is found, this causes an
81 Associated with this extension, the <B><A HREF="init_pair.3x.html">init_pair(3x)</A></B> function
82 accepts negative arguments to specify default foreground
87 <H2>PORTABILITY</H2><PRE>
88 These routines are specific to ncurses. They were not
89 supported on Version 7, BSD or System V implementations.
90 It is recommended that any code depending on them be con-
91 ditioned using NCURSES_VERSION.
95 <H2>SEE ALSO</H2><PRE>
96 <B><A HREF="curs_color.3x.html">curs_color(3x)</A></B>, <B><A HREF="ded.1.html">ded(1)</A></B>.
101 Thomas Dickey (from an analysis of the requirements for
102 color xterm for XFree86 3.1.2C, February 1996).
132 Man(1) output converted with
133 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>