1XcmsAllocColor(3) XLIB FUNCTIONS XcmsAllocColor(3)
2
3
4
6 XcmsAllocColor, XcmsAllocNamedColor - allocate colors
7
9 Status XcmsAllocColor(Display *display, Colormap colormap, XcmsColor
10 *color_in_out, XcmsColorFormat result_format);
11
12 Status XcmsAllocNamedColor(Display *display, Colormap colormap, char
13 *color_string, XcmsColor *color_screen_return, XcmsColor
14 *color_exact_return, XcmsColorFormat result_format);
15
17 display Specifies the connection to the X server.
18
19 colormap Specifies the colormap.
20
21 color_exact_return
22 Returns the color specification parsed from the color string
23 or parsed from the corresponding string found in a color-name
24 database.
25
26 color_in_out
27 Specifies the color to allocate and returns the pixel and
28 color that is actually used in the colormap.
29
30 color_screen_return
31 Returns the pixel value of the color cell and color specifi‐
32 cation that actually is stored for that cell.
33
34 color_string
35 Specifies the color string whose color definition structure
36 is to be returned.
37
38 result_format
39 Specifies the color format for the returned color specifica‐
40 tion.
41
43 The XcmsAllocColor function is similar to XAllocColor except the color
44 can be specified in any format. The XcmsAllocColor function ultimately
45 calls XAllocColor to allocate a read-only color cell (colormap entry)
46 with the specified color. XcmsAllocColor first converts the color
47 specified to an RGB value and then passes this to XAllocColor. XcmsAl‐
48 locColor returns the pixel value of the color cell and the color speci‐
49 fication actually allocated. This returned color specification is the
50 result of converting the RGB value returned by XAllocColor into the
51 format specified with the result_format argument. If there is no
52 interest in a returned color specification, unnecessary computation can
53 be bypassed if result_format is set to XcmsRGBFormat. The correspond‐
54 ing colormap cell is read-only. If this routine returns XcmsFailure,
55 the color_in_out color specification is left unchanged.
56
57 XcmsAllocColor can generate a BadColor errors.
58
59 The XcmsAllocNamedColor function is similar to XAllocNamedColor except
60 that the color returned can be in any format specified. This function
61 ultimately calls XAllocColor to allocate a read-only color cell with
62 the color specified by a color string. The color string is parsed into
63 an XcmsColor structure (see XcmsLookupColor), converted to an RGB
64 value, and finally passed to XAllocColor. If the color name is not in
65 the Host Portable Character Encoding, the result is implementation-
66 dependent. Use of uppercase or lowercase does not matter.
67
68 This function returns both the color specification as a result of pars‐
69 ing (exact specification) and the actual color specification stored
70 (screen specification). This screen specification is the result of
71 converting the RGB value returned by XAllocColor into the format speci‐
72 fied in result_format. If there is no interest in a returned color
73 specification, unnecessary computation can be bypassed if result_format
74 is set to XcmsRGBFormat. If color_screen_return and color_exact_return
75 point to the same structure, the pixel field will be set correctly, but
76 the color values are undefined.
77
78 XcmsAllocNamedColor can generate a BadColor errors.
79
81 BadColor A value for a Colormap argument does not name a defined Col‐
82 ormap.
83
85 XcmsQueryColor(3), XcmsStoreColor(3)
86 Xlib - C Language X Interface
87
88
89
90X Version 11 libX11 1.6.7 XcmsAllocColor(3)