add.color.values(x, new=F, overwrite=F, warn=T)
"#FF0000"
or
"#FF000080"
.
The element names will be used as the color names. Names must start
with a letter. See the
help for details on the
format.
T
,
the previous colors will be discarded. If
F
, the specified colors will
be added to the current table of colors.
new = F
.
If
T
, the new values will be used. If
F
, the previous values will be
retained.
new = F
and
overwrite = F
. If
T
, a warning is generated for each
new value that is ignored.
The
add.color.values()
function modifies the color name mapping. It takes a named character vector of RGB values in the form
"#FF0000"
or
"#FF000080"
. The names are used as the color names, and the values as the RGB values.
Additional arguments determine whether to discard the current table of names, and whether the old or new color definition should be used when a specified name is already in the table.
S-PLUS includes some preconstructed sets of colors that can be used with
add.color.values()
to get commonly used color mappings.
# Add new colors "upsbrown" and "rojo" add.color.values(c(upsbrown="#964B00", rojo="#FF0000")) # Use the CSS colors as the only named colors add.color.values(css.colors, new = T) # Use the X11 colors when no matching CSS colors add.color.values(x11.colors) # Use the X11 colors when no matching CSS colors, don't warn of name conflicts add.color.values(x11.colors, warn = F) # Use the X11 colors, use X11 value when name conflicts add.color.values(x11.colors, overwrite = T)