colorgradient.x: Color gradient for continuous variable

View source: R/colorgradient.x.R

colorgradient.xR Documentation

Color gradient for continuous variable

Description

Color gradient for continuous variable

Usage

colorgradient.x(
  x,
  symmetric = FALSE,
  lo.col = "#0290EE",
  mid.col = "#1A1A1A",
  hi.col = "#FFBD4F",
  space = "Lab"
)

Arguments

x

Float, vector

symmetric

Logical: If TRUE, make symmetric gradient between -max(abs(x)) and max(abs(x))

lo.col

Low color

mid.col

Middle color

hi.col

High color

space

Character: "rgb" or "Lab". Default = "Lab"

Author(s)

E.D. Gennatas

Examples

## Not run: 
x <- seq(-10, 10, length.out = 51)
previewcolor(colorgradient.x(x))
x <- sort(rnorm(40))
previewcolor(colorgradient.x(x, mid.col = "white"))
# Notice how most values are near zero therefore almost white

## End(Not run)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.