2 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
4 .\" Permission is hereby granted, free of charge, to any person obtaining
5 .\" a copy of this software and associated documentation files (the
6 .\" "Software"), to deal in the Software without restriction, including
7 .\" without limitation the rights to use, copy, modify, merge, publish,
8 .\" distribute, sublicense, and/or sell copies of the Software, and to
9 .\" permit persons to whom the Software is furnished to do so, subject to
10 .\" the following conditions:
12 .\" The above copyright notice and this permission notice shall be included
13 .\" in all copies or substantial portions of the Software.
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 .\" OTHER DEALINGS IN THE SOFTWARE.
23 .\" Except as contained in this notice, the name of the X Consortium shall
24 .\" not be used in advertising or otherwise to promote the sale, use or
25 .\" other dealings in this Software without prior written authorization
26 .\" from the X Consortium.
28 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
29 .\" Digital Equipment Corporation
31 .\" Portions Copyright \(co 1990, 1991 by
34 .\" Permission to use, copy, modify and distribute this documentation for
35 .\" any purpose and without fee is hereby granted, provided that the above
36 .\" copyright notice appears in all copies and that both that copyright notice
37 .\" and this permission notice appear in all copies, and that the names of
38 .\" Digital and Tektronix not be used in in advertising or publicity pertaining
39 .\" to this documentation without specific, written prior permission.
40 .\" Digital and Tektronix makes no representations about the suitability
41 .\" of this documentation for any purpose.
42 .\" It is provided ``as is'' without express or implied warranty.
45 .ds xT X Toolkit Intrinsics \- C Language Interface
46 .ds xW Athena X Widgets \- C Language X Toolkit Interface
47 .ds xL Xlib \- C Language X Interface
48 .ds xC Inter-Client Communication Conventions Manual
55 .\".if \\n(VS>=40 .vs \\n(VSu
56 .\".if \\n(VS<=39 .vs \\n(VSp
79 .de IN \" send an index entry to the stderr
86 .\" choose appropriate monospace font
87 .\" the imagen conditional, 480,
88 .\" may be changed to L if LB is too
89 .\" heavy for your eyes...
91 .ie "\\*(.T"480" .ft L
92 .el .ie "\\*(.T"300" .ft L
93 .el .ie "\\*(.T"202" .ft PO
94 .el .ie "\\*(.T"aps" .ft CW
97 .ie \\n(VS>40 .vs \\n(VSu
105 .ie t \\$1\fB\^\\$2\^\fR\\$3
106 .el \\$1\fI\^\\$2\^\fP\\$3
109 .ie t \fB\^\\$1\^\fR\\$2
110 .el \fI\^\\$1\^\fP\\$2
113 .ie t <\fB\\$1\fR>\\$2
119 .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
120 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1
134 . \" Note End -- doug kraft 3/85
143 .TH XQueryColor __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
145 XQueryColor, XQueryColors, XLookupColor, XParseColor \- obtain color values
148 int XQueryColor\^(\^Display *\fIdisplay\fP\^, Colormap \fIcolormap\fP\^, XColor
149 *\fIdef_in_out\fP\^);
151 int XQueryColors\^(\^Display *\fIdisplay\fP\^, Colormap \fIcolormap\fP\^,
152 XColor \fIdefs_in_out\fP[\^]\^, int \fIncolors\fP\^);
154 Status XLookupColor\^(\^Display *\fIdisplay\fP\^, Colormap \fIcolormap\fP\^,
155 char *\fIcolor_name\fP\^, XColor *\fIexact_def_return\fP\^, XColor
156 *\fIscreen_def_return\fP\^);
158 Status XParseColor\^(\^Display *\fIdisplay\fP\^, Colormap \fIcolormap\fP\^,
159 char *\fIspec\fP\^, XColor *\fIexact_def_return\fP\^);
161 .IP \fIcolormap\fP 1i
162 Specifies the colormap.
163 .IP \fIcolor_name\fP 1i
164 Specifies the color name string (for example, red) whose color
165 definition structure you want returned.
166 .IP \fIdef_in_out\fP 1i
167 Specifies and returns the RGB values for the pixel specified in the structure.
168 .IP \fIdefs_in_out\fP 1i
169 Specifies and returns an array of color definition structures for the pixel
170 specified in the structure.
172 Specifies the connection to the X server.
173 .IP \fIexact_def_return\fP 1i
174 Returns the exact RGB values.
176 .\"Specifies the number of color definition structures.
177 Specifies the number of
179 structures in the color definition array.
180 .IP \fIscreen_def_return\fP 1i
181 Returns the closest RGB values provided by the hardware.
183 Specifies the color name string;
185 .IP \fIexact_def_return\fP 1i
186 Returns the exact color value for later use and sets the
195 function returns the current RGB value for the pixel in the
197 structure and sets the
205 function returns the RGB value for each pixel in each
207 structure and sets the
212 flags in each structure.
226 function looks up the string name of a color with respect to the screen
227 associated with the specified colormap.
228 It returns both the exact color values and
229 the closest values provided by the screen
230 with respect to the visual type of the specified colormap.
231 If the color name is not in the Host Portable Character Encoding,
232 the result is implementation-dependent.
233 Use of uppercase or lowercase does not matter.
235 returns nonzero if the name is resolved;
236 otherwise, it returns zero.
240 function looks up the string name of a color with respect to the screen
241 associated with the specified colormap.
242 It returns the exact color value.
243 If the color name is not in the Host Portable Character Encoding,
244 the result is implementation-dependent.
245 Use of uppercase or lowercase does not matter.
247 returns nonzero if the name is resolved;
248 otherwise, it returns zero.
257 An RGB Device specification is identified by
258 the prefix ``rgb:'' and conforms to the following syntax:
260 .\" Start marker code here
262 rgb:\fI<red>/<green>/<blue>\fP
264 \fI<red>\fP, \fI<green>\fP, \fI<blue>\fP := \fIh\fP | \fIhh\fP | \fIhhh\fP | \fIhhhh\fP
265 \fIh\fP := single hexadecimal digits (case insignificant)
267 .\" End marker code here
269 Note that \fIh\fP indicates the value scaled in 4 bits,
270 \fIhh\fP the value scaled in 8 bits,
271 \fIhhh\fP the value scaled in 12 bits,
272 and \fIhhhh\fP the value scaled in 16 bits, respectively.
274 For backward compatibility, an older syntax for RGB Device is
275 supported, but its continued use is not encouraged.
276 The syntax is an initial sharp sign character followed by
277 a numeric specification, in one of the following formats:
282 \&#RRGGBB (8 bits each)
283 \&#RRRGGGBBB (12 bits each)
284 \&#RRRRGGGGBBBB (16 bits each)
287 The R, G, and B represent single hexadecimal digits.
288 When fewer than 16 bits each are specified,
289 they represent the most significant bits of the value
290 (unlike the ``rgb:'' syntax, in which values are scaled).
291 For example, the string ``#3a7'' is the same as ``#3000a0007000''.
293 An RGB intensity specification is identified
294 by the prefix ``rgbi:'' and conforms to the following syntax:
296 .\" Start marker code here
298 rgbi:\fI<red>/<green>/<blue>\fP
300 .\" End marker code here
302 Note that red, green, and blue are floating-point values
303 between 0.0 and 1.0, inclusive.
304 The input format for these values is an optional sign,
305 a string of numbers possibly containing a decimal point,
306 and an optional exponent field containing an E or e
307 followed by a possibly signed integer string.
309 The standard device-independent string specifications have
310 the following syntax:
312 .\" Start marker code here
314 CIEXYZ:\fI<X>/<Y>/<Z>\fP
315 CIEuvY:\fI<u>/<v>/<Y>\fP
316 CIExyY:\fI<x>/<y>/<Y>\fP
317 CIELab:\fI<L>/<a>/<b>\fP
318 CIELuv:\fI<L>/<u>/<v>\fP
319 TekHVC:\fI<H>/<V>/<C>\fP
321 .\" End marker code here
323 All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are
324 floating-point values.
325 The syntax for these values is an optional plus or minus sign,
326 a string of digits possibly containing a decimal point,
327 and an optional exponent field consisting of an ``E'' or ``e''
328 followed by an optional plus or minus followed by a string of digits.
332 A value for a Colormap argument does not name a defined Colormap.
335 Some numeric value falls outside the range of values accepted by the request.
336 Unless a specific range is specified for an argument, the full range defined
337 by the argument's type is accepted. Any argument defined as a set of
338 alternatives can generate this error.
340 XAllocColor(__libmansuffix__),
341 XCreateColormap(__libmansuffix__),
342 XStoreColors(__libmansuffix__)