powered by
This function defines a color palette and returns a vector of colors. The palettes itself are adapted from the ColorBrewer project.
colorPalette(n = NULL, type = "spectral", inv = F)
number of colors to produce
sets the type of color palette. See Details
revert the order of colors
returns a vector of colors to be passed to image or rasterImage
image
rasterImage
The parameter type controls the output palette type as follows:
type
spectral colors from blue to red
spectral colors from green to red
MultiHue yellow - green
MultiHue yellow - green blue
MultiHue yellow - orange - brown
MultiHue yellow - orange red
red - white - blue colors
reproduces the rainbow color set
gray scale colors
gray scale colors from white to black
dark blue to dark red
HZDR cooperate design colors
If a vector of color names is supported, then a customized palette will be calculated according to these colors.
http://colorbrewer2.org by Cynthia A. Brewer, Geography, Pennsylvania State University
# NOT RUN { # default "spectral" palette barplot(rep(1,10), col = colorPalette(10)) # custom color palette barplot(rep(1,10), col = colorPalette(n = 10, type = c("red","blue","yellow"))) # }
Run the code above in your browser using DataLab