X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fcurs_color.3x.html;h=4f6a34b0efe663c5d734a4185c64c074ddbcc828;hp=1ec2985902fd55f0d23e6225e1d703cb268e0c46;hb=29a36e53e1f77a0c3672f2e267d573823d6a9a60;hpb=aabb3a65ee5d88949abe529b5131adedb9cfab84 diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html index 1ec29859..4f6a34b0 100644 --- a/doc/html/man/curs_color.3x.html +++ b/doc/html/man/curs_color.3x.html @@ -1,6 +1,6 @@ @@ -45,32 +48,33 @@ - -

NAME

+

NAME

        start_color, init_pair, init_color, has_colors,
-       can_change_color, color_content, pair_content, COLOR_PAIR
-       - curses color manipulation routines
+       can_change_color, color_content, pair_content, COLOR_PAIR,
+       PAIR_NUMBER - curses color manipulation routines
 
 
-
-

SYNOPSIS

-       # include <curses.h>
+

SYNOPSIS

+       #include <curses.h>
 
        int start_color(void);
        int init_pair(short pair, short f, short b);
        int init_color(short color, short r, short g, short b);
+
        bool has_colors(void);
        bool can_change_color(void);
+
        int  color_content(short  color, short *r, short *g, short
        *b);
        int pair_content(short pair, short *f, short *b);
 
+       int COLOR_PAIR(int n);
+       PAIR_NUMBER(attrs);
 
-
-

DESCRIPTION

 
-
-

Overview

+

DESCRIPTION

+
+

Overview

        curses supports color attributes on  terminals  with  that
        capability.   To  use  these  routines start_color must be
        called, usually right after initscr.   Colors  are  always
@@ -79,8 +83,8 @@
        background color (for the blank field on which the charac-
        ters are displayed).  A programmer  initializes  a  color-
        pair  with  the routine init_pair.  After it has been ini-
-       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
-       can be used as a new video attribute.
+       tialized, COLOR_PAIR(n) can be used to convert the pair to
+       a video attribute.
 
        If  a  terminal  is capable of redefining colors, the pro-
        grammer can use the routine init_color to change the defi-
@@ -94,8 +98,7 @@
        how a given color-pair is currently defined.
 
 
-
-

Color Rendering

+

Color Rendering

        The curses library combines these inputs  to  produce  the
        actual  foreground  and  background  colors  shown  on the
        screen:
@@ -107,9 +110,9 @@
        o   the background character (e.g., wbkgdset).
 
        Per-character and window attributes are usually set  by  a
-       parameter  containing  video  attributes  including a COL-
-       OR_PAIR value.  Some functions such  as  wattr_set  use  a
-       separate parameter which is the color pair number.
+       parameter  containing  video  attributes including a color
+       pair value.  Some functions such as wattr_set use a  sepa-
+       rate parameter which is the color pair number.
 
        The  background character is a special case: it includes a
        character value, just as if it were passed to waddch.
@@ -140,8 +143,7 @@
        background character.
 
 
-
-

Routine Descriptions

+

Routine Descriptions

        The start_color routine requires no arguments.  It must be
        called if the programmer wants to use colors,  and  before
        any  other  color  manipulation  routine is called.  It is
@@ -273,12 +275,21 @@
        to  by  the  second and third arguments are in the range 0
        through COLORS, inclusive.
 
+       PAIR_NUMBER(attrs) extracts the color value from its attrs
+       parameter  and returns it as a color pair number.  Its in-
+       verse COLOR_PAIR(n) converts a color pair number to an at-
+       tribute.   Attributes  can hold color pairs in the range 0
+       to 255.  If you need a color pair larger  than  that,  you
+       must  use functions such as attr_set (which pass the color
+       pair as a separate parameter) rather than the legacy func-
+       tions such as attrset.
 
-
-

Colors

+
+

Colors

        In <curses.h> the following macros are defined.  These are
-       the  default colors.  curses also assumes that COLOR_BLACK
-       is the default background color for all terminals.
+       the standard colors (ISO-6429).  curses also assumes  that
+       COLOR_BLACK is the default background color for all termi-
+       nals.
 
              COLOR_BLACK
              COLOR_RED
@@ -290,8 +301,7 @@
              COLOR_WHITE
 
 
-
-

RETURN VALUE

+

RETURN VALUE

        The routines can_change_color()  and  has_colors()  return
        TRUE or FALSE.
 
@@ -319,8 +329,7 @@
                located.
 
 
-
-

NOTES

+

NOTES

        In the ncurses implementation, there is a  separate  color
        activation flag, color palette, color pairs table, and as-
        sociated COLORS and COLOR_PAIRS counts  for  each  screen;
@@ -351,8 +360,7 @@
        o   Color RGB values are not settable.
 
 
-
-

PORTABILITY

+

PORTABILITY

        This  implementation  satisfies XSI Curses's minimum maxi-
        mums for COLORS and COLOR_PAIRS.
 
@@ -370,8 +378,7 @@
        will treat those as optional parameters when null.
 
 
-
-

SEE ALSO

+

SEE ALSO

        curses(3x),  curs_initscr(3x),  curs_attr(3x),  curs_vari-
        ables(3x), default_colors(3x)