XQueryColor
NAMESYNTAX
ARGUMENTS
DESCRIPTION
COLOR NAMES
DIAGNOSTICS
SEE ALSO
NAME
XQueryColor, XQueryColors, XLookupColor, XParseColor − obtain color values
SYNTAX
int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out); | |
int XQueryColors(Display *display, Colormap colormap, XColor defs_in_out[], int ncolors); | |
Status XLookupColor(Display *display, Colormap colormap, char *color_name, XColor *exact_def_return, XColor *screen_def_return); | |
Status XParseColor(Display *display, Colormap colormap, char *spec, XColor *exact_def_return); |
ARGUMENTS
colormap |
Specifies the colormap. |
color_name
Specifies the color name string (for example, red) whose color definition structure you want returned.
def_in_out
Specifies and returns the RGB values for the pixel specified in the structure.
defs_in_out
Specifies and returns an array of color definition structures for the pixel specified in the structure.
display |
Specifies the connection to the X server. |
exact_def_return
Returns the exact RGB values.
ncolors |
Specifies the number of XColor structures in the color definition array. |
screen_def_return
Returns the closest RGB values provided by the hardware.
spec |
Specifies the color name string; case is ignored. |
exact_def_return
Returns the exact color value for later use and sets the DoRed, DoGreen, and DoBlue flags.
DESCRIPTION
The XQueryColor function returns the current RGB value for the pixel in the XColor structure and sets the DoRed, DoGreen, and DoBlue flags. The XQueryColors function returns the RGB value for each pixel in each XColor structure and sets the DoRed, DoGreen, and DoBlue flags in each structure.
XQueryColor and XQueryColors can generate BadColor and BadValue errors.
The XLookupColor function looks up the string name of a color with respect to the screen associated with the specified colormap. It returns both the exact color values and the closest values provided by the screen with respect to the visual type of the specified colormap. If the color name is not in the Host Portable Character Encoding, the result is implementation-dependent. Use of uppercase or lowercase does not matter. XLookupColor returns nonzero if the name is resolved; otherwise, it returns zero.
The XParseColor function looks up the string name of a color with respect to the screen associated with the specified colormap. It returns the exact color value. If the color name is not in the Host Portable Character Encoding, the result is implementation-dependent. Use of uppercase or lowercase does not matter. XParseColor returns nonzero if the name is resolved; otherwise, it returns zero.
XLookupColor and XParseColor can generate BadColor error.
COLOR NAMES
An RGB Device specification is identified by the prefix ‘‘rgb:’’ and conforms to the following syntax:
rgb:<red>/<green>/<blue>
<red>,
<green>, <blue> := h |
hh | hhh | hhhh
h := single hexadecimal digits (case insignificant)
Note that h indicates the value scaled in 4 bits, hh the value scaled in 8 bits, hhh the value scaled in 12 bits, and hhhh the value scaled in 16 bits, respectively.
For backward compatibility, an older syntax for RGB Device is supported, but its continued use is not encouraged. The syntax is an initial sharp sign character followed by a numeric specification, in one of the following formats:
The R, G, and B represent single hexadecimal digits. When fewer than 16 bits each are specified, they represent the most significant bits of the value (unlike the ‘‘rgb:’’ syntax, in which values are scaled). For example, the string ‘‘#3a7’’ is the same as ‘‘#3000a0007000’’.
An RGB intensity specification is identified by the prefix ‘‘rgbi:’’ and conforms to the following syntax:
rgbi:<red>/<green>/<blue>
Note that red, green, and blue are floating-point values between 0.0 and 1.0, inclusive. The input format for these values is an optional sign, a string of numbers possibly containing a decimal point, and an optional exponent field containing an E or e followed by a possibly signed integer string.
The standard device-independent string specifications have the following syntax:
CIEXYZ:<X>/<Y>/<Z>
CIEuvY:<u>/<v>/<Y>
CIExyY:<x>/<y>/<Y>
CIELab:<L>/<a>/<b>
CIELuv:<L>/<u>/<v>
TekHVC:<H>/<V>/<C>
All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are floating-point values. The syntax for these values is an optional plus or minus sign, a string of digits possibly containing a decimal point, and an optional exponent field consisting of an ‘‘E’’ or ‘‘e’’ followed by an optional plus or minus followed by a string of digits.
DIAGNOSTICS
BadColor |
A value for a Colormap argument does not name a defined Colormap. | ||
BadValue |
Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument’s type is accepted. Any argument defined as a set of alternatives can generate this error. |
SEE ALSO
XAllocColor(3),
XCreateColormap(3), XStoreColors(3)
Xlib − C Language X Interface
More Linux Commands
manpages/dracut-pre-pivot.service.8.html
dracut-pre-pivot.service(8) runs the dracut hooks before swi
This service runs all dracut hooks before the system switched to the real root. AUTHORS Harald Hoyer SEE ALSO dracut.bootup(7) dracut(8) dracut-pre-pivot.servic
manpages/slk_clear.3ncurses.html
slk_clear(3ncurses) - curses soft label routines (Man Page)
The slk* functions manipulate the set of soft function-key labels that exist on many terminals. For those terminals that do not have soft labels, curses takes o
manpages/ntpq.1.html
ntpq(1) - standard NTP query program - Linux manual page....
This manual page briefly documents the ntpq command. The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 co
manpages/Tcl_SetErrno.3.html
Tcl_SetErrno(3) - manipulate errno to store and retrieve err
Tcl_SetErrno and Tcl_GetErrno provide portable access to the errno variable, which is used to record a POSIX error code after system calls and other operations
manpages/mvwinchnstr.3ncurses.html
mvwinchnstr(3ncurses) - get a string of characters (and attr
These routines return a NULL-terminated array of chtype quantities, starting at the current cursor position in the named window and ending at the right margin o
manpages/msiexec.1.html
msiexec(1) - Wine MSI Installer (Commands - Linux man page)
msiexec is the Wine MSI installer, which is command line compatible with its Microsoft Windows counterpart. INSTALL OPTIONS /i {package|productcode} [property=f
manpages/perlrebackslash.1.html
perlrebackslash(1) - Perl Regular Expression Backslash Seque
The top level documentation about Perl regular expressions is found in perlre. This document describes all backslash and escape sequences. After explaining the
manpages/c++.1.html
c++(1) - GNU project C and C++ compiler - Linux manual page
When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The overall options allow you to stop this process at an intermediate st
manpages/glMap1d.3gl.html
glMap1d(3gl) - define a one-dimensional evaluator (ManPage)
Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by
manpages/Tk_GetScreenMM.3.html
Tk_GetScreenMM(3) - translate between strings and screen uni
These procedures take as argument a specification of distance on the screen (objPtr or string) and compute the corresponding distance either in integer pixels o
manpages/pts.4.html
pts(4) - pseudoterminal master and slave - Linux man page...
The file /dev/ptmx is a character file with major number 5 and minor number 2, usually of mode 0666 and owner.group of root.root. It is used to create a pseudot
manpages/wadd_wch.3ncurses.html
wadd_wch(3ncurses) - add a complex character and rendition t
The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions put the complex character wch into the given window at its current position, which is then advanced.
