XStoreColors(3)
π XStoreColors(3) β XLIB FUNCTIONS π
okay bestie, we are officially in XLIB FUNCTIONS territory and this is the XStoreColors(3) page. colors are about to get stored. it's giving palette main character energy. π¨β¨
πΈ NAME πΈ
XStoreColors, XStoreColor, XStoreNamedColor β set colors. that's the whole name, no cap. π
β¨ SYNTAX β¨
int XStoreColors(Display *display, Colormap colormap, XColor color[],
int ncolors);
int XStoreColor(Display *display, Colormap colormap, XColor *color);
int XStoreNamedColor(Display *display, Colormap colormap, _Xconst char
*color, unsigned long pixel, int flags);
π ARGUMENTS π
colorβ specifies the pixel and RGB values or the color name string (for example,red). yes, this one is doing double duty, bestie. πcolorβ specifies an array of color definition structures to be stored. it's the array flavor. ποΈcolormapβ specifies the colormap. the map of colors. iconic. πΊοΈdisplayβ specifies the connection to the X server. your link to the whole situation. πflagsβ specifies which red, green, and blue components are set. π©ncolorsβ specifies the number ofXColorstructures in the color definition array. count 'em. π’pixelβ specifies the entry in the colormap. π
π DESCRIPTION π
XStoreColors is the group-chat announcer of the family: it changes the colormap entries of the pixel values specified in the pixel members of the XColor structures. you tell it which color components are getting changed by setting DoRed, DoGreen, and/or DoBlue in the flags member of the XColor structures. if the colormap is an installed map for its screen, the changes are visible immediately. boom, instant glow-up. β¨
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. and if more than one pixel is in error, the one that gets reported is arbitrary β lowkey chaotic, but that's the rule. π
XStoreColors can generate BadAccess, BadColor, and BadValue errors.
XStoreColor is the solo version: it changes the colormap entry of the pixel value specified in the pixel member of the XColor structure. you specified this value in the pixel member of the XColor structure. this 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. you specify which color components are to be changed by setting DoRed, DoGreen, and/or DoBlue in the flags member of the XColor structure. if the colormap is an installed map for its screen, the changes are visible immediately. slay, immediate visual feedback. π
XStoreColor can generate BadAccess, BadColor, and BadValue errors.
XStoreNamedColor is the name-dropper: it looks up the named color with respect to the screen associated with the colormap and stores the result in the specified 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 this member to the bitwise inclusive OR of the bits DoRed, DoGreen, and DoBlue. π§
if the color name is not in the Host Portable Character Encoding, the result is implementation-dependent. use of uppercase or lowercase does not matter. 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. π€·ββοΈ
XStoreNamedColor can generate BadAccess, BadColor, BadName, and BadValue errors.
π₯ DIAGNOSTICS π₯
BadAccessβ a client attempted to free a color map entry that it did not already allocate. rude. π€BadAccessβ a client attempted to store into a read-only color map entry. same error name, different crime. πBadColorβ a value for aColormapargument does not name a definedColormap. the map is not mapping, bestie. πΊοΈβBadNameβ a font or color of the specified name does not exist. name not found, no cap. π·οΈβBadValueβ 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 defined by the argument's type is accepted. any argument defined as a set of alternatives can generate this error. numbers said "not today." π’π«
π¦ SEE ALSO π¦
XAllocColor(3)XCreateColormap(3)XQueryColor(3)Xlib - C Language X Interface
and that's the whole color-storing saga, bestie. this page's footer energy is X Version 11 + libX11 1.8.14, and the title is ofc XStoreColors(3). go forth and store colors responsibly. mwah. ππ«Άβ¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms