use.device.palette(use=NULL)
palette()
or
image.palette()
function is used. If NULL, the value is
not changed.
use
is
NULL
the current setting of this
flag is returned. Otherwise, the setting before the value was changed
is returned invisibly.
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.
# 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)