Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XAllocColor(3X)

XCreateColormap(3X)

XQueryColor(3X)




XStoreColors(3X) XStoreColors(3X)
NAME XStoreColors, XStoreColor, XStoreNamedColor - set colors SYNOPSIS XStoreColors (display, colormap, color, ncolors) Display *display; Colormap colormap; XColor color[]; int ncolors; XStoreColor (display, colormap, color) Display *display; Colormap colormap; XColor *color; XStoreNamedColor (display, colormap, color, pixel, flags) Display *display; Colormap colormap; char *color; unsigned long pixel; int flags; DESCRIPTION The XStoreColors function changes the colormap entries of the pixel values specified in the pixel members of the XColor structures. The color components that are to be changed are specified by setting the bitwise inclusive OR of DoRed, DoGreen, and DoBlue in the flags member of the XColor struc- tures. If the colormap is an installed map for its screen, the changes are visible immediately. XStoreColors changes the specified pixels if they are allocated writable in the colormap by any client, even if one or more pixels generates an error. If a specified pixel is not a valid index into the colormap, a BadValue error results. If a specified pixel either is unallocated or is allocated read-only, a BadAccess error results. If more than one pixel is in error, the one that is reported is arbitrary. The XStoreColor function changes the colormap entry of the pixel value specified in the pixel member of the XColor structure. The pixel value must be a read/write cell and a valid index into the colormap. If a specified pixel is not a valid index into the colormap, a BadValue error results. XStoreColor also changes the red, green, and/or blue color components. The color components that are to be changed are specified by setting the bitwise inclusive OR of DoRed, Do- Green, and DoBlue in the flags member of the XColor struc- ture. If the colormap is an installed map for its screen, the changes are visible immediately. November, 1990 1



XStoreColors(3X) XStoreColors(3X)
The XStoreNamedColor function looks up the named color with respect to the screen associated with colormap and stores the result in colormap. The pixel argument determines the entry in the colormap. The flags argument determines which of the red, green, and blue components are set. You can set flags to the bitwise inclusive OR of DoRed, DoGreen, and DoBlue. If the specified pixel is not a valid index into the colormap, a BadValue error results. If the specified pixel either is unallocated or is allocated read-only, a BadAccess error results. You should use the ISO Latin-1 encoding; case does not matter. Arguments These functions accept the following arguments: colormap Specifies the colormap ID. color Specifies the pixel and red, green, and blue (RGB) values; or, specifies an array of color definition structures to be stored. display Specifies the connection to the X server. flags Specifies which RGB indexes are set. ncolors Specifies the number of XColor structures in the color definition array. pixel Specifies the entry in the colormap. ERRORS BadAccess A client attempted to free a colormap entry that it did not already allocate; or, a client attempted to store into a read-only colormap entry. BadColor A value for a Colormap argument does not name a de- fined colormap. BadName A font or color of the specified name does not ex- ist. BadValue A numeric value falls outside the range of values accepted by the request. Unless a range is speci- fied 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. 2 November, 1990



XStoreColors(3X) XStoreColors(3X)
The XStoreColor and XStoreColors functions can generate Ba- dAccess, BadColor, and BadValue errors. The XStoreNamedColor function can generate BadAccess, Bad- Color, BadName, and BadValue errors. SEE ALSO XAllocColor(3X), XCreateColormap(3X), XQueryColor(3X)
Xlib - C Language Interface
November, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026