colors Color Names
Description
Returns the built-in color names which R knows about.
Usage
colors (distinct = FALSE) colours(distinct = FALSE)
Arguments
distinct | logical indicating if the colors returned should all be distinct; e.g., |
Details
These color names can be used with a col= specification in graphics functions.
An even wider variety of colors can be created with primitives rgb, hsv and hcl, or the derived rainbow, heat.colors, etc.
"transparent" is not a color and so not listed, but it is accepted as a color specification.
Value
A character vector containing all the built-in color names.
See Also
palette for setting the ‘palette’ of colors for par(col=<num>); rgb, hsv, hcl, gray; rainbow for a nice example; and heat.colors, topo.colors for images.
col2rgb for translating to RGB numbers and extended examples.
Examples
cl <- colors()
length(cl); cl[1:20]
length(cl. <- colors(TRUE))
## only 502 of the 657 named ones
## ----------- Show all named colors and more:
demo("colors")
## -----------
Copyright (©) 1999–2012 R Foundation for Statistical Computing.
Licensed under the GNU General Public License.