XQueryColor()XQueryColor()Name
XQueryColor – obtain the RGB values and flags for a specified color‐
cell.
Synopsis
XQueryColor(display, colormap, def_in_out)
Display *display;
Colormap colormap;
XColor *def_in_out;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
colormap Specifies 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.
DescriptionXQueryColor() returns the RGB values in colormap colormap for the col‐
orcell 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
BadColor Invalid colormap.
BadValue Pixel not valid index into colormap.
See AlsoXBlackPixel(), XWhitePixel(), XAllocColor(), XAllocColorCells(), XAl‐
locColorPlanes(), XAllocNamedColor(), XFreeColors(), XLookupColor(),
XParseColor(), XQueryColors(), XStoreColor(), XStoreColors(), XStore‐
NamedColor().
Xlib - Color Cells XQueryColor()