xcb_alloc_named_color(3)
π xcb_alloc_named_color β a lil XCB Requests page, bestie π
okay so. this is xcb_alloc_named_color(3), from the XCB Requests family, and it's literally the request that goes "hey X11 server, i have a color name and i want a pixel for it." yes she's giving β¨named color allocationβ¨. sit down, hydrate, let's go π
β¨ SYNOPSIS β¨
first things first, you gotta pull in the header:
#include <xcb/xproto.h>
π Request function
xcb_alloc_named_color_cookie_t
xcb_alloc_named_color(xcb_connection_t *conn,
xcb_colormap_t cmap, uint16_t name_len, const char *name);
π¦ Reply datastructure
typedef struct xcb_alloc_named_color_reply_t {
uint8_t response_type;
uint8_t pad0;
uint16_t sequence;
uint32_t length;
uint32_t pixel;
uint16_t exact_red;
uint16_t exact_green;
uint16_t exact_blue;
uint16_t visual_red;
uint16_t visual_green;
uint16_t visual_blue;
} xcb_alloc_named_color_reply_t;
πΈ Reply function
xcb_alloc_named_color_reply_t
*xcb_alloc_named_color_reply(xcb_connection_t *conn,
xcb_alloc_named_color_cookie_t cookie, xcb_generic_error_t **e);
π REQUEST ARGUMENTS π
connβ your XCB connection to X11, aka the whole entire reason any of this works. the group chat line to the server, if you will π«Άcmapβ TODO: NOT YET DOCUMENTED. yeah bestie the docs just... didn't. iconic of them tbh πname_lenβ TODO: NOT YET DOCUMENTED. no thoughts, head empty πnameβ TODO: NOT YET DOCUMENTED. the mystery continues π΅οΈ
π REPLY FIELDS π
response_typeβ the type of this reply, and in this case it'sXCB_ALLOC_NAMED_COLOR. this field also lives in thexcb_generic_reply_t, so you can use it to tell replies apart from each other. she's the little name tag at the party πsequenceβ the sequence number of the last request processed by the X11 server. like a lil receipt number fr fr π§Ύlengthβ the length of the reply, in words. and before you ask: a word is4bytes. no cap πpixelβ TODO: NOT YET DOCUMENTED. π«exact_redβ TODO: NOT YET DOCUMENTED. πexact_greenβ TODO: NOT YET DOCUMENTED. πexact_blueβ TODO: NOT YET DOCUMENTED. πvisual_redβ TODO: NOT YET DOCUMENTED. πvisual_greenβ TODO: NOT YET DOCUMENTED. πvisual_blueβ TODO: NOT YET DOCUMENTED. π
π§ DESCRIPTION π§
so... this section is empty in the original. like, actually empty. nothing. void. the audacity π no description for you bestie, go read the reply fields i guess π¦
β RETURN VALUE β
she hands you back an xcb_alloc_named_color_cookie_t πͺ and β important β errors have to be handled when you call the reply function xcb_alloc_named_color_reply.
ok but what if you'd rather handle errors in the event loop instead?? then usexcb_alloc_named_color_unchecked, periodt. seexcb-requests(3)for the deets π
π ERRORS π
this request does never generate any errors. not one. zero. she's a good girl, she behaves π
π SEE ALSO π
(same energy as DESCRIPTION tbh β there's nothing listed here in the original. empty. nada. moving on β¨)
π AUTHOR π
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. (so if something's wrong, that's who you @ in the group chat π§)
and that's the whole page!! this came to you from X Version 11 and libxcb 1.17.0, filed under xcb_alloc_named_color(3). bye bestie, go allocate some named colors responsibly πβ¨π
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms