Status XcmsLookupColor(display, colormap, color_string, color_exact_return, color_screen_return,
      Display *display;
      Colormap colormap;
      char *color_string;
      XcmsColor *color_exact_return, *color_screen_return;
      XcmsColorFormat result_format;


display Specifies the connection to the X server.
colormap Specifies the colormap.
color_string Specifies the color string.
color_exact_return Returns the color specification parsed from the color string or parsed from the corresponding string found in a color name database.
color_screen_return Returns the color that can be reproduced on the screen.
result_format Specifies the color format for the returned color specifications (color_screen_return and color_exact_return arguments). If the format is XcmsUndefinedFormat and the color string contains a numerical color specification, the specification is returned in the format used in that numerical color specification. If the format is XcmsUndefinedFormat and the color string contains a color name, the specification is returned in the format used to store the color in the database.


The XcmsLookupColor() 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. The values are returned in the format specified by result_format. 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. XcmsLookupColor() returns XcmsSuccess or XcmsSuccessWithCompression if the name is resolved; otherwise, it returns XcmsFailure. If XcmsSuccessWithCompression is returned, the color specification returned in color_screen_return is the result of gamut compression.

See also

XcmsAllocColor(), XcmsQueryColor(), XcmsQueryColors(), XcmsStoreColor(), XQueryColor(), "Mapping Color Names to Values".
Christophe Tronche, [email protected]