XLookupColor

Syntax

Status XLookupColor(display, colormap, color_name, exact_def_return, screen_def_return)
      Display *display;
      Colormap colormap;
      char *color_name;
      XColor *exact_def_return, *screen_def_return;

Arguments

display Specifies the connection to the X server.
colormap Specifies the colormap.
color_name Specifies the color name string (for example, red) whose color definition structure you want returned.
exact_def_return Returns the exact RGB values.
screen_def_return Returns the closest RGB values provided by the hardware.

Description

The XLookupColor() function looks up the string name of a color with respect to the screen associated with the specified colormap. It returns both the exact color values and the closest values provided by the screen with respect to the visual type of the specified colormap. 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. XLookupColor() returns nonzero if the name is resolved; otherwise, it returns zero.

XLookupColor() can generate a BadColor error.

Diagnostics

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

See also

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