XcupStoreColors(3)
β¨ XcupStoreColors β¨
okay bestie, so this one is a lil X function from the Xcup extension, and she's basically the colormap glow-up you call when you want your colors to be shareable instead of hogged by one app π
we're talking XcupStoreColors(3) today. let's get into it π«Ά
πΈ SYNOPSIS πΈ
cc [ flag ... ] file ... -lXext [ library ... ]
#include <X11/extensions/Xcup.h>
Status XcupStoreColors(Display *display, Colormap colormap,
XColor *colors_in_out, int ncolors);
π ARGUMENTS π
displayβ the connection to the X server, obvi π₯οΈcolormapβ the colormap, the one we're messing withcolors_in_outβ here's the β¨iconicβ¨ part: this one is both input and output. You hand her values, she gives you back the values that actually got used in the colormap πncolorsβ how many items live incolors_in_out, so count them correctly bestie, she's not psychic π
π DESCRIPTION π
So XcupStoreColors changes the colormap entries of the pixel values sitting in the pixel members of the XColor structures. the way she allocates them? exactly as if an AllocColor had been used β which means the colors are read-only and shareable. no hogging, we're all sharing the vibe here π§
And what does she give you back? XcupStoreColors returns the number of colors that were successfully allocated in the colormap. not all of them necessarily β just the ones that slayed π
β οΈ now the important part, no cap: a Value error is generated if apixelis not a valid index into the colormap. and a BadMatch error is generated if the colormap does not belong to aGrayScale,PseudoColor, orDirectColorvisual. so like, check your visual first, bestie π
okay so why should you care?? apps that allocate a LOT of colors in a screen's default colormap β think a color-cube or a gray-ramp, the heavy stuff β should allocate them with XCupStoreColors. by using XCupStoreColors the colors get allocated shareable (read-only) and any other application that allocates the same color will share that color cell. literally communal color ownership, it's giving community garden but for pixels ππ₯
π SEE ALSO π
XcupQueryVersion(3Xext)XcupGetReservedColormapEntries(3Xext)Colormap Utilization Policy and Extension
and that's the whole thing, bestie π«Ά this page came to you straight outta X Version 11, with libXext 1.3.6 holding it down β XcupStoreColors(3), periodt πβ¨
π¦ where this page comes from
- alpine 3.22: libxext-doc 1.3.6-r2 Β· MIT
- alpine 3.23: libxext-doc 1.3.6-r2 Β· MIT
- centos-stream 10: libXext-devel 1.3.6-3.el10 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 43: libXext-devel 1.3.6-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 43: libXext-devel 1.3.6-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 44: libXext-devel 1.3.6-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 44: libXext-devel 1.3.6-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- Copyright (c) 1999, 2005, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms