Generate a green-white-red color sequence of a given length.
number of colors to be returned
color change power
logical: should the user be warned that this function produces a palette unsuitable for people with most common color blindness?
The function returns a color vector that starts with green, gradually turns into white and then to
red. The power
gamma can be used to control the behaviour of the quarter- and three quarter-values
(between green and white, and white and red, respectively). Higher powers will make the mid-colors more
white, while lower powers will make the colors more saturated, respectively.
Typical use of this function is to produce (via function
a color representation of numbers within a symmetric interval
around 0, for example, the interval [-1, 1]. Note though that since green and red are not distinguishable by
people with the most common type of color blindness, we recommend using the analogous palette returned by
A vector of colors of length
blueWhiteRed for a color sequence more friendly to people with the most common type of color
numbers2colors for a function that produces a color representation for continuous numbers.
1 2 3 4 5 6 7
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.