Amiga Unix — 68040 · 68060

Manual pages › X Window and screen libraries (3X)

XQColor(3X)

obtain color values

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

NAME

XQueryColor, XQueryColors, XLookupColor - obtain color values

SYNTAX

XQueryColor(display, colormap, def_in_out)
      Display *display;
      Colormap colormap;
      XColor *def_in_out;

XQueryColors(display, colormap, defs_in_out, ncolors)
      Display *display;
      Colormap colormap;
      XColor defs_in_out[];
      int ncolors;

Status XLookupColor(display, colormap, color_name,
exact_def_return,
                    screen_def_return)
      Display *display;
      Colormap colormap;
      char *color_name;
      XColor *exact_def_return, *screen_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 struc-
          ture.

display   Specifies the connection to the XWIN 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.

XWIN 3.0               Last change: 9/1/88                 .ie t

DESCRIPTION

The XQueryColor function returns the RGB values for each
pixel in the XColor structures and sets the DoRed, DoGreen,
and DoBlue flags.  The XQueryColors function returns the RGB
values for each pixel in the XColor structures and sets the
DoRed, DoGreen, and DoBlue flags.

XQueryColor and XQueryColors can generate BadColor and Bad-Value errors.

The XLookupColor function looks up the string name of a
color with respect to the screen associated with the speci-
fied 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.  You should use
the ISO Latin-1 encoding; uppercase and lowercase do not
matter.  XLookupColor returns nonzero if the name existed in
the color database or zero if it did not exist.

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 gen-
          erate this error.

SEE ALSO

     XAllocColor(3X11),
     XCreateColormap(3X11),
     XStoreColors(3X11)
     Xlib - C Language X Interface

XWIN 3.0               Last change: 9/1/88                 .ie t

XWIN 3.0               Last change: 9/1/88                 .ie t