visColormap {supraHex} | R Documentation |
visColormap
is supposed to define a colormap. It returns a
function, which will take an integer argument specifying how many
colors interpolate the given colormap.
visColormap(colormap = c("bwr", "jet", "gbr", "wyr", "br", "yr", "rainbow", "wb", "heat", "terrain", "topo", "cm"))
colormap |
short name for the colormap. It can also be a function of 'colorRampPalette' |
palette.name
: a function that takes an integer argument
for generating that number of colors interpolating the given sequence
The input colormap includes:
"jet": jet colormap
"bwr": blue-white-red
"gbr": green-black-red
"wyr": white-yellow-red
"br": black-red
"yr": yellow-red
"wb": white-black
"rainbow": rainbow colormap, that is, red-yellow-green-cyan-blue-magenta
Alternatively, any hyphen-separated HTML color names, e.g. "blue-black-yellow", "royalblue-white-sandybrown", "darkblue-lightblue-lightyellow-darkorange", "darkgreen-white-darkviolet", "darkgreen-lightgreen-lightpink-darkred". A list of standard color names can be found in http://html-color-codes.info/color-names
# 1) define "blue-white-red" colormap palette.name <- visColormap(colormap="bwr") # 2) use the return function "palette.name" to generate 10 colors spanning "bwr" palette.name(10)