XStoreColor

Syntax

XStoreColor(display, colormap, color)
      Display *display;
      Colormap colormap;
      XColor *color;

Arguments

display Specifies the connection to the X server.
colormap Specifies the colormap.
color Specifies the pixel and RGB values.

Description

The XStoreColor() function changes the colormap entry of the pixel value specified in the pixel member of the XColor structure. You specified this value in the pixel member of the XColor structure. This pixel value must be a read/write cell and a valid index into the colormap. If a specified pixel is not a valid index into the colormap, a BadValue error results. XStoreColor() also changes the red, green, and/or blue color components. You specify which color components are to be changed by setting DoRed , DoGreen , and/or DoBlue in the flags member of the XColor structure. If the colormap is an installed map for its screen, the changes are visible immediately.

XStoreColor() can generate BadAccess , BadColor , and BadValue errors.

Diagnostics

BadAccess A client attempted to free a color map entry that it did not already allocate.
BadAccess A client attempted to store into a read-only color map entry.
BadColor A value for a Colormap argument does not name a defined Colormap.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.

See also

XAllocColor(), XCreateColormap(), XQueryColor(), XStoreColors(), XStoreNamedColor(), "Modifying and Querying Colormap Cells".
Christophe Tronche, [email protected]