XStoreNamedColor() XStoreNamedColor()
Name
XStoreNamedColor - set RGB values of a read/write colorcell by color name.
Synopsis
XStoreNamedColor(display, colormap, color, pixel, flags)
Display *display;
Colormap colormap;
char *color;
unsigned long pixel;
int flags;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
colormap
Specifies the colormap.
color Specifies the color name string (for example, "red"). This cannot be in hex format (as used in XParseColor()). Uppercase or low-
ercase is not important. The string should be in ISO LATIN-1 encoding, which means that the first 128 character codes are ASCII,
and the second 128 character codes are for special characters needed in western languages other than English.
pixel Specifies the entry in the colormap to store color in.
flags Specifies which red, green, and blue indexes are set.
Description
XStoreNamedColor() looks up the named color in the database, with respect to the screen associated with colormap, then stores the result in
the read/write colorcell of colormap specified by pixel. If the color name is not in the Host Portable Character Encoding, the result is
implementation-dependent. Uppercase or lowercase in name does not matter. The flags argument, a bitwise OR of the constants DoRed,
DoGreen, and DoBlue, determines which subfields within the pixel value in the cell are written.
For more information, see Volume One, Chapter 7, Color.
Errors
BadAccess pixel is unallocated or read-only.
BadColor Invalid colormap.
BadName color is not in server's color database.
BadValue pixel is not a valid index into colormap.
See Also
XDefaultColormap(), XDisplayCells(), XCopyColormapAndFree(), XCreateColormap(), XFreeColormap(), XGetStandardColormap(), XInstallCol-
ormap(), XListInstalledColormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallColormap().
Xlib - Window Manager Hints XStoreNamedColor()