Diverging colour gradient (continuous).
Usage
pal_div_gradient(
low = "#2B6788",
mid = "#CBCBCB",
high = "#90503F",
space = "Lab"
)
div_gradient_pal(
low = "#2B6788",
mid = "#CBCBCB",
high = "#90503F",
space = "Lab"
)
Examples
x <- seq(-1, 1, length.out = 100)
r <- sqrt(outer(x^2, x^2, "+"))
image(r, col = pal_div_gradient()(seq(0, 1, length.out = 12)))
image(r, col = pal_div_gradient()(seq(0, 1, length.out = 30)))
image(r, col = pal_div_gradient()(seq(0, 1, length.out = 100)))
pal <- pal_div_gradient(low = "#2E6A70")
image(r, col = pal(seq(0, 1, length.out = 100)))