xgetrgb(type="polygons", scale=1)
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.
# 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"))