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

NAME

6       XcmsQueryColor, XcmsQueryColors, XcmsLookupColor - obtain color values
7

SYNTAX

9       Status  XcmsQueryColor(Display  *display,  Colormap colormap, XcmsColor
10              *color_in_out, XcmsColorFormat result_format);
11
12       Status XcmsQueryColors(Display *display, Colormap  colormap,  XcmsColor
13              colors_in_out[],   unsigned  int  ncolors,  XcmsColorFormat  re‐
14              sult_format);
15
16       Status XcmsLookupColor(Display  *display,  Colormap  colormap,  _Xconst
17              char  *color_string,  XcmsColor  *color_exact_return,  XcmsColor
18              *color_screen_return, XcmsColorFormat result_format);
19

ARGUMENTS

21       display   Specifies the connection to the X server.
22
23       colormap  Specifies the colormap.
24
25       color_exact_return
26                 Returns the color specification parsed from the color  string
27                 or parsed from the corresponding string found in a color-name
28                 database.
29
30       color_in_out
31                 Specifies the pixel member that indicates the color  cell  to
32                 query.   The color specification stored for the color cell is
33                 returned in this XcmsColor structure.
34
35       color_screen_return
36                 Returns the color that can be reproduced on the screen.
37
38       color_string
39                 Specifies the color string.
40
41       result_format
42                 Specifies the color format for the returned color  specifica‐
43                 tions (color_screen_return and color_exact_return arguments).
44                 If the format is XcmsUndefinedFormat  and  the  color  string
45                 contains  a  numerical color specification, the specification
46                 is returned in the format used in that numerical color speci‐
47                 fication.  If the format is XcmsUndefinedFormat and the color
48                 string contains a color name, the specification  is  returned
49                 in the format used to store the color in the database.
50
51       ncolors   Specifies  the  number  of XcmsColor structures in the color-
52                 specification array.
53

DESCRIPTION

55       The XcmsQueryColor function obtains the RGB value for the  pixel  value
56       in  the pixel member of the specified XcmsColor structure and then con‐
57       verts the value to the target format as specified by the  result_format
58       argument.  If the pixel is not a valid index in the specified colormap,
59       a BadValue error results.  The XcmsQueryColors function obtains the RGB
60       values  for  pixel  values in the pixel members of XcmsColor structures
61       and then converts the values to the target format as specified  by  the
62       result_format argument.  If a pixel is not a valid index into the spec‐
63       ified colormap, a BadValue error results.  If more than one pixel is in
64       error, the one that gets reported is arbitrary.
65
66       XcmsQueryColor  and  XcmsQueryColors can generate BadColor and BadValue
67       errors.
68
69       The XcmsLookupColor function looks up the string name of a  color  with
70       respect  to  the screen associated with the specified colormap.  It re‐
71       turns both the exact color values and the closest  values  provided  by
72       the  screen  with respect to the visual type of the specified colormap.
73       The values are returned in the format specified by  result_format.   If
74       the  color name is not in the Host Portable Character Encoding, the re‐
75       sult is implementation-dependent.  Use of uppercase or  lowercase  does
76       not matter.  XcmsLookupColor returns XcmsSuccess or XcmsSuccessWithCom‐
77       pression if the name is resolved; otherwise,  it  returns  XcmsFailure.
78       If  XcmsSuccessWithCompression is returned, the color specification re‐
79       turned in color_screen_return is the result of gamut compression.
80

DIAGNOSTICS

82       BadColor  A value for a Colormap argument does not name a defined  Col‐
83                 ormap.
84
85       BadValue  Some numeric value falls outside the range of values accepted
86                 by the request.  Unless a specific range is specified for  an
87                 argument,  the  full  range defined by the argument's type is
88                 accepted.  Any argument defined as a set of alternatives  can
89                 generate this error.
90

SEE ALSO

92       XcmsAllocColor(3), XcmsStoreColor(3), XQueryColor(3)
93       Xlib - C Language X Interface
94
95
96
97X Version 11                    libX11 1.7.3.1               XcmsQueryColor(3)
Impressum