XQueryColor(3X) — X Version 11
NAME
XQueryColor, XQueryColors, XLookupColor − obtain color values
SYNTAX
XQueryColor(display, cmap, def_return)
Display ∗display;
Colormap cmap;
XColor ∗def_return;
XQueryColors(display, cmap, defs_return, ncolors)
Display ∗display;
Colormap cmap;
XColor defs_return[];
int ncolors;
Status XLookupColor(display, cmap, color_name, visual_def_return, exact_def_return)
Display ∗display;
Colormap cmap;
char ∗color_name;
XColor ∗visual_def_return, ∗exact_def_return;
ARGUMENTS
cmapSpecifies the color map ID.
def_in_outSpecifies or returns the RGB values for the pixel specified in the structure.
defs_in_outSpecifies or returns an array of color definition structures.
displaySpecifies the connection to the X server.
exact_def_return
Returns the exact RGB values.
ncolorsSpecifies the number of XColor structures in the color definition array.
exact_def_return
Returns the exact colors for later use and sets the DoRed, DoGreen, and DoBlue flags.
DESCRIPTION
The XQueryColor and XQueryColors functions returns the red, green, and blue color values stored in the specified color map for the pixel value you pass in the pixel member of the XColor structure(s). The values returned for an unallocated entry are undefined. They also set the flags member in the XColor structure to all three colors. .PN XQueryColor and .PN XQueryColors can generate BadColor and BadValue errors.
The XLookupColor function looks up the string name of a color with respect to the screen associated with the specified cmap and returns both the exact color values and the closest values provided by the screen with respect to the visual type of the specified cmap.
DIAGNOSTICS
BadColor A value for a Colormap argument does not name a defined Colormap.
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 defined by the argument’s type is accepted. Any argument defined as a set of alternatives can generate this error.
SEE ALSO
XAllocColor(3X), XCreateColormap(3X), XStoreColors(3X)
Xlib − C Language X Interface
1 March 1988