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=9cf3791793c61a09817f73d332d3461949a74655;hb=29a36e53e1f77a0c3672f2e267d573823d6a9a60;hpb=6208c89f98f1cf9fe0980bd8e791846ce007a13d diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html index 9cf37917..4f6a34b0 100644 --- a/doc/html/man/curs_color.3x.html +++ b/doc/html/man/curs_color.3x.html @@ -1,6 +1,6 @@ @@ -47,22 +50,26 @@

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>
+       #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

@@ -76,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-
@@ -103,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.
@@ -268,10 +275,19 @@
        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

        In <curses.h> the following macros are defined.  These are
-       the  standard colors (ISO-6429).  curses also assumes that
+       the standard colors (ISO-6429).  curses also assumes  that
        COLOR_BLACK is the default background color for all termi-
        nals.
 
@@ -286,79 +302,79 @@
 
 
 

RETURN VALUE

-       The  routines  can_change_color()  and has_colors() return
+       The routines can_change_color()  and  has_colors()  return
        TRUE or FALSE.
 
        All other routines return the integer ERR upon failure and
-       an  OK  (SVr4  specifies only "an integer value other than
+       an OK (SVr4 specifies only "an integer  value  other  than
        ERR") upon successful completion.
 
-       X/Open defines no error conditions.   This  implementation
-       will  return  ERR  on attempts to use color values outside
+       X/Open  defines  no error conditions.  This implementation
+       will return ERR on attempts to use  color  values  outside
        the range 0 to COLORS-1 (except for the default colors ex-
-       tension),  or  use color pairs outside the range 0 to COL-
-       OR_PAIRS-1.  Color values used in init_color  must  be  in
-       the  range 0 to 1000.  An error is returned from all func-
-       tions if the terminal has not been initialized.  An  error
-       is  returned from secondary functions such as init_pair if
+       tension), or use color pairs outside the range 0  to  COL-
+       OR_PAIRS-1.   Color  values  used in init_color must be in
+       the range 0 to 1000.  An error is returned from all  func-
+       tions  if the terminal has not been initialized.  An error
+       is returned from secondary functions such as init_pair  if
        start_color was not called.
 
           init_color
-               returns an error if the terminal does not  support
-               this  feature, e.g., if the initialize_color capa-
+               returns  an error if the terminal does not support
+               this feature, e.g., if the initialize_color  capa-
                bility is absent from the terminal description.
 
           start_color
-               returns an error if the color table cannot be  al-
+               returns  an error if the color table cannot be al-
                located.
 
 
 

NOTES

-       In  the  ncurses implementation, there is a separate color
+       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;
-       the start_color function only affects the current  screen.
+       sociated COLORS and COLOR_PAIRS counts  for  each  screen;
+       the  start_color function only affects the current screen.
        The SVr4/XSI interface is not really designed with this in
-       mind, and historical  implementations  may  use  a  single
+       mind,  and  historical  implementations  may  use a single
        shared color palette.
 
        Note that setting an implicit background color via a color
-       pair affects only character cells that a  character  write
-       operation  explicitly  touches.   To change the background
-       color used when parts of a window are blanked  by  erasing
+       pair  affects  only character cells that a character write
+       operation explicitly touches.  To  change  the  background
+       color  used  when parts of a window are blanked by erasing
        or scrolling operations, see curs_bkgd(3x).
 
-       Several  caveats  apply  on 386 and 486 machines with VGA-
+       Several caveats apply on 386 and 486  machines  with  VGA-
        compatible graphics:
 
-       o   COLOR_YELLOW is actually brown.  To  get  yellow,  use
+       o   COLOR_YELLOW  is  actually  brown.  To get yellow, use
            COLOR_YELLOW combined with the A_BOLD attribute.
 
        o   The A_BLINK attribute should in theory cause the back-
-           ground to go bright.  This often fails  to  work,  and
+           ground  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
+           Paradise  and compatibles) do the wrong thing when you
+           try to set a bright "yellow"  background  (you  get  a
            blinking yellow foreground instead).
 
        o   Color RGB values are not settable.
 
 
 

PORTABILITY

-       This implementation satisfies XSI Curses's  minimum  maxi-
+       This  implementation  satisfies XSI Curses's minimum maxi-
        mums for COLORS and COLOR_PAIRS.
 
-       The  init_pair  routine  accepts  negative values of fore-
-       ground  and  background  color  to  support  the   use_de-
-       fault_colors  extension, but only if that routine has been
+       The init_pair routine accepts  negative  values  of  fore-
+       ground   and  background  color  to  support  the  use_de-
+       fault_colors extension, but only if that routine has  been
        first invoked.
 
-       The assumption that COLOR_BLACK is the default  background
-       color  for  all  terminals  can  be modified using the as-
+       The  assumption that COLOR_BLACK is the default background
+       color for all terminals can  be  modified  using  the  as-
        sume_default_colors extension.
 
-       This implementation checks the  pointers,  e.g.,  for  the
-       values  returned  by  color_content  and pair_content, and
+       This  implementation  checks  the  pointers, e.g., for the
+       values returned by  color_content  and  pair_content,  and
        will treat those as optional parameters when null.