XcmsAllocColor() XcmsAllocColor()
Name
XcmsAllocColor - allocate a color specified in device-independent or device-dependent form.
Synopsis
Status XcmsAllocColor(display, colormap, color_in_out, result_format)
Display *display;
Colormap colormap;
XcmsColor *color_in_out;
XcmsColorFormat result_format;
Arguments
display Specifies the connection to the X server.
colormap Specifies the colormap.
color_in_out
Specifies the color to allocate and returns the pixel and color that is actually used in the colormap.
result_format
Specifies the desired color format for the returned color specification.
Returns
Zero on failure, non-zero on success.
Availability
Release 5 and later.
Description
The XcmsAllocColor() function is similar to XAllocColor() except the color can be specified in any format supported by the color management
system (e.g., CIEXYZ, CIELUV, RGB). The XcmsAllocColor() function ultimately calls XAllocColor() to allocate a read-only color cell (col-
ormap entry) with the specified color. XcmsAllocColor() first converts the color specified to an RGB value and then passes this to XAlloc-
Color. XcmsAllocColor() returns the pixel value of the color cell and the color specification actually allocated. This returned color
specification is the result of converting the RGB value returned by XAllocColor() into the format specified by the result_format argument.
If there is no interest in a returned color specification, unnecessary computation can be bypassed if result_format is set to XcmsRGBFor-
mat. If this routine returns XcmsFailure, the color_in_out color specification is left unchanged.
Structures
The XcmsColor and XcmsColorFormat structures are shown on the XcmsColor reference page.
Errors
BadColor The colormap argument does not name a defined Colormap.
See Also
XcmsAllocNamedColor(), XcmsLookupColor(), XcmsQueryColor(), XcmsQueryColors(), XcmsStoreNamedColor.
Xlib - Device-independent Color XcmsAllocColor()