continuous-palettes: Continuous color palettes

Description Usage Arguments Value Examples

Description

Continuous color palettes

Usage

1
2
3
4
5
6
7
8
chroma_continuous_pal(
  colors = c("yellow", "navy"),
  mode = "lab",
  padding = NULL,
  correct_lightness = TRUE
)

bezier_continuous_pal(colors = c("yellow", "red", "black"))

Arguments

colors

Vector of hexadecimal strings or names for colors.

mode

Color space used for interpolation.

padding

Reduces the color range by cutting of a fraction of the gradient on both sides. If you pass a single number, the same padding will be applied to both ends.

correct_lightness

Makes sure the lightness range is spread evenly across a color scale.

Value

a function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
x <- seq(0, 1, length.out = 25)
view_cols(chroma_continuous_pal()(x))

# change mode
view_cols(chroma_continuous_pal(mode = "lch")(x))


# Bezier interpolation
view_cols(bezier_continuous_pal()(x))

# Color Brewer :
view_cols(chroma_continuous_pal("RdYlBu")(x))
# add some padding :
view_cols(chroma_continuous_pal("RdYlBu", padding = 0.15)(x))

dreamRs/colorscale documentation built on April 17, 2020, 8:38 a.m.