XParseColor

Syntax

Status XParseColor(display, colormap, spec, exact_def_return)
        Display *display;
        Colormap colormap;
        char *spec;
        XColor *exact_def_return;

Arguments

display Specifies the connection to the X server.
colormap Specifies the colormap.
spec Specifies the color name string; case is ignored.
exact_def_return Returns the exact color value for later use and sets the DoRed , DoGreen , and DoBlue flags.

Description

The XParseColor() function looks up the string name of a color with respect to the screen associated with the specified colormap. It returns the exact color value. 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. XParseColor() returns nonzero if the name is resolved; otherwise, it returns zero.

XParseColor() can generate a BadColor error.

Diagnostics

BadColor A value for a Colormap argument does not name a defined Colormap.

See also

XAllocColor(), XCreateColormap(), XLookupColor(), XQueryColor(), XQueryColors(), XStoreColors(), "Mapping Color Names to Values".
Christophe Tronche, [email protected]