Use Device-Specific Palette or Global Palette

DESCRIPTION:

Determines how integer values are mapped to RGB values in graphics.

USAGE:

use.device.palette(use=NULL)

OPTIONAL ARGUMENTS:

use
If T, the integer is passed to the device and the color is determined in a device-specific manner. If F, the palette() or image.palette() function is used. If NULL, the value is not changed.

VALUE:

If use is NULL the current setting of this flag is returned. Otherwise, the setting before the value was changed is returned invisibly.

SIDE EFFECTS:

Changes an internal flag used to determine whether integers specifying colors are resolved into RGB values at the device level or using the global palette and image palette.

DETAILS:

This setting is primarily intended for S-PLUS 7 and earlier users that have graphics code taking advantage of device-specific palettes. S-PLUS 8 introduced a global palette system, and the expectation is that users will transition to the new system. In the interim, this setting provides a way to stay with the device-specific palette system while taking advantage of other graphics enhancements.

This is an application-level setting that cannot be changed while devices exist. If any devices are open and use is specified, the function will stop with an error message.

A related function use.legacy.graphics is available that indicates whether the new graphics code will be used at all. When that setting is TRUE, old code that is not aware of the new palette system is called and the device-specific palette is always used.

SEE ALSO:

, .

EXAMPLES:

# Get the current setting
use.device.palette()

# Use the RGB values from palette() and image.palette()
use.device.palette(F)

# Use the RGB values specific to the device
use.device.palette(T)