1XcmsAllocColor(3)               XLIB FUNCTIONS               XcmsAllocColor(3)
2
3
4

NAME

6       XcmsAllocColor, XcmsAllocNamedColor - allocate colors
7

SYNTAX

9       Status  XcmsAllocColor(Display  *display,  Colormap colormap, XcmsColor
10              *color_in_out, XcmsColorFormat result_format);
11
12       Status XcmsAllocNamedColor(Display *display, Colormap colormap, _Xconst
13              char  *color_string,  XcmsColor  *color_screen_return, XcmsColor
14              *color_exact_return, XcmsColorFormat result_format);
15

ARGUMENTS

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.  Specifies  the
33                 color  string  whose  color definition structure is to be re‐
34                 turned.
35
36       result_format
37                 Specifies the color format for the returned color  specifica‐
38                 tion.
39

DESCRIPTION

41       The  XcmsAllocColor function is similar to XAllocColor except the color
42       can be specified in any format.  The XcmsAllocColor function ultimately
43       calls  XAllocColor  to allocate a read-only color cell (colormap entry)
44       with the specified color.   XcmsAllocColor  first  converts  the  color
45       specified to an RGB value and then passes this to XAllocColor.  XcmsAl‐
46       locColor returns the pixel value of the color cell and the color speci‐
47       fication  actually allocated.  This returned color specification is the
48       result of converting the RGB value returned  by  XAllocColor  into  the
49       format  specified  with the result_format argument.  If there is no in‐
50       terest in a returned color specification, unnecessary  computation  can
51       be  bypassed if result_format is set to XcmsRGBFormat.  The correspond‐
52       ing colormap cell is read-only.  If this routine  returns  XcmsFailure,
53       the color_in_out color specification is left unchanged.
54
55       XcmsAllocColor can generate a BadColor errors.
56
57       The  XcmsAllocNamedColor function is similar to XAllocNamedColor except
58       that the color returned can be in any format specified.  This  function
59       ultimately  calls  XAllocColor  to allocate a read-only color cell with
60       the color specified by a color string.  The color string is parsed into
61       an  XcmsColor  structure  (see  XcmsLookupColor),  converted  to an RGB
62       value, and finally passed to XAllocColor.  If the color name is not  in
63       the  Host Portable Character Encoding, the result is implementation-de‐
64       pendent.  Use of uppercase or lowercase does not matter.
65
66       This function returns both the color specification as a result of pars‐
67       ing  (exact  specification)  and  the actual color specification stored
68       (screen specification).  This screen specification  is  the  result  of
69       converting the RGB value returned by XAllocColor into the format speci‐
70       fied in result_format.  If there is no interest  in  a  returned  color
71       specification, unnecessary computation can be bypassed if result_format
72       is set to XcmsRGBFormat.  If color_screen_return and color_exact_return
73       point to the same structure, the pixel field will be set correctly, but
74       the color values are undefined.
75
76       XcmsAllocNamedColor can generate a BadColor errors.
77

DIAGNOSTICS

79       BadColor  A value for a Colormap argument does not name a defined  Col‐
80                 ormap.
81

SEE ALSO

83       XcmsQueryColor(3), XcmsStoreColor(3)
84       Xlib - C Language X Interface
85
86
87
88X Version 11                     libX11 1.7.0                XcmsAllocColor(3)
Impressum