summaryrefslogtreecommitdiff
path: root/doc/html/man/curs_color.3x.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/man/curs_color.3x.html')
-rw-r--r--doc/html/man/curs_color.3x.html73
1 files changed, 59 insertions, 14 deletions
diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html
index 591ed40..22964c4 100644
--- a/doc/html/man/curs_color.3x.html
+++ b/doc/html/man/curs_color.3x.html
@@ -1,6 +1,6 @@
-<!--
+<!--
****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -27,7 +27,7 @@
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_color.3x,v 1.62 2020/02/02 23:34:34 tom Exp @
+ * @Id: curs_color.3x,v 1.66 2021/09/04 19:42:20 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
@@ -61,22 +61,22 @@
<STRONG>bool</STRONG> <STRONG>has_colors(void);</STRONG>
<STRONG>bool</STRONG> <STRONG>can_change_color(void);</STRONG>
- <STRONG>int</STRONG> <STRONG>init_pair(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>f,</STRONG> <STRONG>short</STRONG> <STRONG>b);</STRONG>
- <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>
+ <STRONG>int</STRONG> <STRONG>init_pair(short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>f</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>b</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>init_color(short</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>r</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>g</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>b</EM><STRONG>);</STRONG>
/* extensions */
- <STRONG>int</STRONG> <STRONG>init_extended_pair(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>f,</STRONG> <STRONG>int</STRONG> <STRONG>b);</STRONG>
- <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>
+ <STRONG>int</STRONG> <STRONG>init_extended_pair(int</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>f</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>b</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>init_extended_color(int</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>r</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>g</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>b</EM><STRONG>);</STRONG>
- <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> <STRONG>*b);</STRONG>
- <STRONG>int</STRONG> <STRONG>pair_content(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>*f,</STRONG> <STRONG>short</STRONG> <STRONG>*b);</STRONG>
+ <STRONG>int</STRONG> <STRONG>color_content(short</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>r</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>g</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>b</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>pair_content(short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>f</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>b</EM><STRONG>);</STRONG>
/* extensions */
- <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> <STRONG>*b);</STRONG>
- <STRONG>int</STRONG> <STRONG>extended_pair_content(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>*f,</STRONG> <STRONG>int</STRONG> <STRONG>*b);</STRONG>
+ <STRONG>int</STRONG> <STRONG>extended_color_content(int</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>r</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>g</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>b</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>extended_pair_content(int</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>f</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>b</EM><STRONG>);</STRONG>
/* extensions */
<STRONG>void</STRONG> <STRONG>reset_color_pairs(void);</STRONG>
- <STRONG>int</STRONG> <STRONG>COLOR_PAIR(int</STRONG> <STRONG>n);</STRONG>
+ <STRONG>int</STRONG> <STRONG>COLOR_PAIR(int</STRONG> <EM>n</EM><STRONG>);</STRONG>
<STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM><STRONG>);</STRONG>
@@ -135,8 +135,8 @@
<STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>not</EM> <EM>blank</EM>, or it does not use
the special color pair 0, <STRONG>curses</STRONG> prefers the color pair from the
- parameter, if it is nonzero. Otherwise, it tries the window at-
- tribute next, and finally the background character.
+ parameter, if it is nonzero. Otherwise, it tries the window attri-
+ bute next, and finally the background character.
Some <STRONG>curses</STRONG> functions such as <STRONG>wprintw</STRONG> call <STRONG>waddch</STRONG>. Those do not com-
bine its parameter with a color pair. Consequently those calls use on-
@@ -439,6 +439,50 @@
<STRONG>o</STRONG> Color RGB values are not settable.
+</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
+ SVr3.2 introduced color support to curses in 1987.
+
+ SVr4 made internal changes, e.g., moving the storage for the color
+ state from <STRONG>SP</STRONG> (the <STRONG>SCREEN</STRONG> structure) to <STRONG>cur_term</STRONG> (the <STRONG>TERMINAL</STRONG> struc-
+ ture), but provided the same set of library functions.
+
+ SVr4 curses limits the number of color pairs to 64, reserving color
+ pair zero (0) as the terminal's initial uncolored state. This limit
+ arises because the color pair information is a bitfield in the <STRONG>chtype</STRONG>
+ data type (denoted by <STRONG>A_COLOR</STRONG>).
+
+ Other implementations of curses had different limits:
+
+ <STRONG>o</STRONG> PCCurses (1987-1990) provided for only eight (8) colors.
+
+ <STRONG>o</STRONG> PDCurses (1992-present) inherited the 8-color limitation from PC-
+ Curses, but changed this to 256 in version 2.5 (2001), along with
+ changing <STRONG>chtype</STRONG> from 16-bits to 32-bits.
+
+ <STRONG>o</STRONG> X/Open Curses (1992-present) added a new structure <STRONG>cchar_t</STRONG> to store
+ the character, attributes and color-pair values, allowing increased
+ range of color-pairs. Both color-pairs and color-values used a
+ signed <STRONG>short</STRONG>, limiting values to 15 bits.
+
+ <STRONG>o</STRONG> ncurses (1992-present) uses eight bits for <STRONG>A_COLOR</STRONG> in <STRONG>chtype</STRONG> val-
+ ues.
+
+ Version 5.3 provided a wide-character interface (2002), but left
+ color-pairs as part of the attributes-field.
+
+ Since version 6 (2015), ncurses uses a separate <STRONG>int</STRONG> for color-pairs
+ in the <STRONG>cchar_t</STRONG> values. When those color-pair values fit in 8 bits,
+ ncurses allows color-pairs to be manipulated via the functions us-
+ ing <STRONG>chtype</STRONG> values.
+
+ <STRONG>o</STRONG> NetBSD curses used 6 bits from 2000 (when colors were first sup-
+ ported) until 2004. At that point, NetBSD changed to use 10 bits.
+ As of 2021, that size is unchanged. Like ncurses before version 6,
+ the NetBSD color-pair information is stored in the attributes field
+ of <STRONG>cchar_t</STRONG>, limiting the number of color-pairs by the size of the
+ bitfield.
+
+
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
This implementation satisfies XSI Curses's minimum maximums for <STRONG>COLORS</STRONG>
and <STRONG>COLOR_PAIRS</STRONG>.
@@ -511,6 +555,7 @@
</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
+<li><a href="#h2-HISTORY">HISTORY</a></li>
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
</ul>