twocolorpal: Create vector of colors from blue to white to red

View source: R/twocolorpal.R

twocolorpalR Documentation

Create vector of colors from blue to white to red

Description

Create a two-color palette from one color to another through some third color

Usage

twocolorpal(colors = c("slateblue", "white", "violetred"), n = 256, ...)

Arguments

colors

Vector of three colors

n

Number of colors in output.

...

Passed to grDevices::colorRampPalette().

Value

Vector of colors, from blue to white to red

See Also

revgray()

Examples

x <- matrix(rnorm(100, 0.5), ncol=10)
mxabs <- max(abs(x))
image(x, col=twocolorpal(), zlim=c(-mxabs, mxabs))


broman documentation built on May 29, 2024, 7:18 a.m.

Related to twocolorpal in broman...