table of contents
XStoreColors(3) | XLIB FUNCTIONS | XStoreColors(3) |
NAME¶
XStoreColors, XStoreColor, XStoreNamedColor - set colors
SYNTAX¶
int XStoreColors(Display *display, Colormap colormap, XColor color[], int ncolors);
int XStoreColor(Display *display, Colormap colormap, XColor *color);
int XStoreNamedColor(Display *display, Colormap colormap, _Xconst char *color, unsigned long pixel, int flags);
ARGUMENTS¶
- color
- Specifies the pixel and RGB values or the color name string (for example, red).
- color
- Specifies an array of color definition structures to be stored.
- colormap
- Specifies the colormap.
- display
- Specifies the connection to the X server.
- flags
- Specifies which red, green, and blue components are set.
- ncolors
- Specifies the number ofXColorstructures in the color definition array.
- pixel
- Specifies the entry in the colormap.
DESCRIPTION¶
TheXStoreColorsfunction changes the colormap entries of the pixel valuesspecified in the pixel members of theXColorstructures.You specify which color components are to be changed by settingDoRed,DoGreen,and/orDoBluein the flags member of theXColorstructures.If the colormap is an installed map for its screen, thechanges are visible immediately.XStoreColorschanges the specified pixels if they are allocated writable in the colormapby any client, even if one or more pixels generates an error.If a specified pixel is not a valid index into the colormap, aBadValueerror results.If a specified pixel either is unallocated or is allocated read-only, aBadAccesserror results.If more than one pixel is in error,the one that gets reported is arbitrary.
XStoreColorscan generateBadAccess,BadColor,andBadValueerrors.
TheXStoreColorfunction changes the colormap entry of the pixel value specified in thepixel member of theXColorstructure.You specified this value in thepixel member of theXColorstructure.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,aBadValueerror results.XStoreColoralso changes the red, green, and/or blue color components.You specify which color components are to be changed by settingDoRed,DoGreen,and/orDoBluein the flags member of theXColorstructure.If the colormap is an installed map for its screen,the changes are visible immediately.
XStoreColorcan generateBadAccess,BadColor,andBadValueerrors.
TheXStoreNamedColorfunction looks up the named color with respect to the screen associated withthe colormap and stores the result in the specified colormap.The pixel argument determines the entry in the colormap.The flags argument determines which of the red, green, and blue componentsare set.You can set this member to thebitwise inclusive OR of the bitsDoRed,DoGreen,andDoBlue.If the color name is not in the Host Portable Character Encoding,the result is implementation-dependent.Use of uppercase or lowercase does not matter.If the specified pixel is not a valid index into the colormap, aBadValueerror results.If the specified pixel either is unallocated or is allocated read-only, aBadAccesserror results.
XStoreNamedColorcan generateBadAccess,BadColor,BadName,andBadValueerrors.
DIAGNOSTICS¶
- BadAccess
- A client attemptedto free a color map entry that it did not already allocate.
- BadAccess
- A client attemptedto store into a read-only color map entry.
- BadColor
- A value for a Colormap argument does not name a defined Colormap.
- BadName
- A font or color of the specified name does not exist.
- 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 definedby the argument's type is accepted.Any argument defined as a set ofalternatives can generate this error.
SEE ALSO¶
XAllocColor(3),XCreateColormap(3),XQueryColor(3)
Xlib - C Language X Interface
libX11 1.8.12 | X Version 11 |