next up previous contents
Next: Read Only Colorcells: An Up: Using Colour Previous: Using Colour

Allocating Color cells

To see how to use Read/Write cells, see a later section. Use Read Only cells if at all possible.

Status XAllocColor(display,cmap,screen_def)
    XColor *screen_def;        /* supplies RGB values.
           RETURNS pixel value closest to the RGB specified
           and the RGB values actually used */

Status XAllocNamedColor(display,cmap,colorname,screen_def,exact_def);
   char *colorname;    /* supplies name of color                           */
   XColor *screen_def; /* RETURNS the values actually used in the colormap */
   XColor *exact_def;  /* RETURNS the closest color provided by the hardware*/

Tim Love
Mon Mar 11 17:03:18 GMT 1996