Scroll to navigation

XcmsStoreColor(3) XLIB FUNCTIONS XcmsStoreColor(3)

NAME

XcmsStoreColor, XcmsStoreColors - set colors

SYNTAX

Status XcmsStoreColor(Display *display, Colormap colormap, XcmsColor *color);

Status XcmsStoreColors(Display *display, Colormap colormap, XcmsColor *colors, unsigned ncolors, Bool *compression_flags_return);

ARGUMENTS

Specifies the connection to the X server.
Specifies the color cell and the color to store.Values specified in thisXcmsColorstructure remain unchanged on return.
Specifies the color specification array ofXcmsColorstructures, each specifying a color cell and the color to store in thatcell.Values specified in the array remain unchanged upon return.
Specifies the colormap.
Returns an array of Boolean values indicating compression status.If a non-NULL pointer is supplied,each element of the array is set toTrueif the corresponding color was compressed andFalseotherwise.Pass NULL if the compression status is not useful.
Specifies the number ofXcmsColorstructures in the color-specification array.

DESCRIPTION

TheXcmsStoreColorfunction converts the color specified in theXcmsColorstructure into RGB values.It then uses this RGB specification in anXColorstructure, whose three flags(DoRed,DoGreen,andDoBlue)are set, in a call toXStoreColorto change the color cell specified by the pixel member of theXcmsColorstructure.This pixel value must be a valid index for the specified colormap,and the color cell specified by the pixel value must be a read/write cell.If the pixel value is not a valid index, aBadValueerror results.If the color cell is unallocated or is allocated read-only, aBadAccesserror results.If the colormap is an installed map for its screen,the changes are visible immediately.

Note thatXStoreColorhas no return value; therefore, anXcmsSuccessreturn value from this function indicates that the conversionto RGB succeeded and the call toXStoreColorwas made.To obtain the actual color stored, useXcmsQueryColor.Because of the screen's hardware limitations or gamut compression,the color stored in the colormap may not be identicalto the color specified.

XcmsStoreColorcan generateBadAccess,BadColor,andBadValueerrors.

TheXcmsStoreColorsfunction converts the colors specified in the array ofXcmsColorstructures into RGB values and then uses these RGB specifications inXColorstructures, whose three flags(DoRed,DoGreen,andDoBlue)are set, in a call toXStoreColorsto change the color cells specified by the pixel member of the correspondingXcmsColorstructure.Each pixel value must be a valid index for the specified colormap,and the color cell specified by each pixel value must be a read/write cell.If a pixel value is not a valid index, aBadValueerror results.If a color cell is unallocated or is allocated read-only, aBadAccesserror results.If more than one pixel is in error,the one that gets reported is arbitrary.If the colormap is an installed map for its screen,the changes are visible immediately.

Note thatXStoreColorshas no return value; therefore, anXcmsSuccessreturn value from this function indicates that conversionsto RGB succeeded and the call toXStoreColorswas made.To obtain the actual colors stored, useXcmsQueryColors.Because of the screen's hardware limitations or gamut compression,the colors stored in the colormap may not be identicalto the colors specified.

XcmsStoreColorscan generateBadAccess,BadColor,andBadValueerrors.

DIAGNOSTICS

A client attemptedto free a color map entry that it did not already allocate.
A client attemptedto store into a read-only color map entry.
A value for a Colormap argument does not name a defined Colormap.
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 definedby the argument's type is accepted.Any argument defined as a set ofalternatives can generate this error.

SEE ALSO

XcmsAllocColor(3),XcmsQueryColor(3)
Xlib - C Language X Interface

libX11 1.8.1 X Version 11