NAME
XQueryColor − obtain the RGB values and flags for a specified colorcell.
Synopsis
XQueryColor(display, colormap, def_in_out)
Display *display;
Colormap colormap;
XColor *def_in_out;
Arguments
displaySpecifies a connection to an X server; returned from XOpenDisplay().
colormapSpecifies the ID of the colormap from which RGB values will be retrieved.
def_in_out
Specifies the pixel value and returns the RGB contents of that colorcell.
Description
XQueryColor() returns the RGB values in colormap colormap for the colorcell corresponding to the pixel value specified in the pixel member of the XColor structure def_in_out. The RGB values are returned in the red, green, and blue members of that structure, and the flags member of that structure is set to (DoRed | DoGreen | DoBlue). The values returned for an unallocated entry are undefined. For more information, see Volume One, Chapter 7, Color.
Structures
typedef struct {
unsigned long pixel;
unsigned short red, green, blue;
char flags;/* DoRed, DoGreen, DoBlue */
char pad;
} XColor;
Errors
BadColorInvalid colormap.
BadValuePixel not valid index into colormap.
See Also
BlackPixel(), WhitePixel(), XAllocColor(), XAllocColorCells(), XAllocColorPlanes(), XFreeColors(), XLookupColor(), XParseColor(), XQueryColors(), XStoreColor(), XStoreColors(),
Copyright O’Reilly & Assoc. —