Inquire current color settings

DESCRIPTION:
Gets the RGB values for the current color scheme from the currently active motif or openlook graphics device.

USAGE:
xgetrgb(type="polygons", scale=1)

OPTIONAL ARGUMENTS:
type:
character string identifying the section of the color scheme that is to be returned. Legal values are "background", "lines", "text", "polygons", and "images". The default is "polygons".
scale:
a number to multiply with the return values to adjust their range. The default is for the red, green and blue components to be returned in the range of 0 to 1.

VALUE:
Returns a 3-column matrix. Each row corresponds to an entry in the color scheme. The first column is the "red" component; the second is the "green" component; and the third is the "blue" component.

DETAILS:
The RGB values as returned by the XAllocColor routine are returned in this matrix.

There may be several duplicate entries if "halftone" color scheme specifications are used. The "halftone" specification is used to "dither" two colors together using a fill pattern. Only two distinct colors are used in that case. For example, a specification of "black h5 white" will result in seven color values being returned. Returns the first half of them as (0,0,0) (or black). The latter half is (1,1,1) (or white).

One use of this function would be to get the colors used by the current device, and use them as a image.colors specification to a postscript device.


WARNING:
This function will only work when a motif or openlook device is the currently active device.

SEE ALSO:
motif , openlook , ps.options , postscript , ps.options.send

EXAMPLES:
# What colors are being used for the image() function?
xgetrgb (type="images")

# Copy the current image plot to a new postscript device. dev.copy (postscript, image.colors=xgetrgb(type="images"))

# Inform the built-in postscript(printgraph) driver of current image colors ps.options.send (image.colors=xgetrgb(type="images"))