1xcb_alloc_color(3)               XCB Requests               xcb_alloc_color(3)
2
3
4

NAME

6       xcb_alloc_color - Allocate a color
7

SYNOPSIS

9       #include <xcb/xproto.h>
10
11   Request function
12       xcb_alloc_color_cookie_t xcb_alloc_color(xcb_connection_t *conn,
13              xcb_colormap_t cmap, uint16_t red, uint16_t green,
14              uint16_t blue);
15
16   Reply datastructure
17       typedef struct xcb_alloc_color_reply_t {
18           uint8_t  response_type;
19           uint8_t  pad0;
20           uint16_t sequence;
21           uint32_t length;
22           uint16_t red;
23           uint16_t green;
24           uint16_t blue;
25           uint8_t  pad1[2];
26           uint32_t pixel;
27       } xcb_alloc_color_reply_t;
28
29   Reply function
30       xcb_alloc_color_reply_t *xcb_alloc_color_reply(xcb_connection_t *conn,
31              xcb_alloc_color_cookie_t cookie, xcb_generic_error_t **e);
32

REQUEST ARGUMENTS

34       conn      The XCB connection to X11.
35
36       cmap      TODO
37
38       red       The red value of your color.
39
40       green     The green value of your color.
41
42       blue      The blue value of your color.
43

REPLY FIELDS

45       response_type
46                 The type of this reply, in this case XCB_ALLOC_COLOR. This
47                 field is also present in the xcb_generic_reply_t and can be
48                 used to tell replies apart from each other.
49
50       sequence  The sequence number of the last request processed by the X11
51                 server.
52
53       length    The length of the reply, in words (a word is 4 bytes).
54
55       red       TODO: NOT YET DOCUMENTED.
56
57       green     TODO: NOT YET DOCUMENTED.
58
59       blue      TODO: NOT YET DOCUMENTED.
60
61       pixel     TODO: NOT YET DOCUMENTED.
62

DESCRIPTION

64       Allocates a read-only colormap entry corresponding to the closest RGB
65       value supported by the hardware. If you are using TrueColor, you can
66       take a shortcut and directly calculate the color pixel value to avoid
67       the round trip. But, for example, on 16-bit color setups (VNC), you can
68       easily get the closest supported RGB value to the RGB value you are
69       specifying.
70

RETURN VALUE

72       Returns an xcb_alloc_color_cookie_t. Errors have to be handled when
73       calling the reply function xcb_alloc_color_reply.
74
75       If you want to handle errors in the event loop instead, use xcb_al‐
76       loc_color_unchecked. See xcb-requests(3) for details.
77

ERRORS

79       xcb_colormap_error_t
80                 The specified colormap cmap does not exist.
81

SEE ALSO

83       xcb-requests(3)
84

AUTHOR

86       Generated from xproto.xml. Contact xcb@lists.freedesktop.org for cor‐
87       rections and improvements.
88
89
90
91X Version 11                      libxcb 1.13               xcb_alloc_color(3)
Impressum