create_single_scale: Create a color scale from a single color

Description Usage Arguments Value Examples

View source: R/single-colorscale.R

Description

Create a color scale from a single color

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
create_single_scale(
  color,
  n_light = 6,
  n_dark = 4,
  lightness = 0.8,
  darkness = 0.5,
  rotate_light = 67,
  rotate_dark = -51,
  saturation_light = 0.2,
  saturation_dark = 0.14
)

Arguments

color

Hexadecimal string or a name of a color.

n_light

Number of light colors to generate.

n_dark

Number of dark colors to generate.

lightness

Percentage of lightness ([0, 1]).

darkness

Percentage of darkness ([0, 1]).

rotate_light

Rotate coefficient in HSL space for light colors ([-360, 360]).

rotate_dark

Rotate coefficient in HSL space for dark colors ([-360, 360]).

saturation_light

Saturation percentage in HSL space for light colors ([-1, 1]).

saturation_dark

Saturation percentage in HSL space for dark colors ([-1, 1]).

Value

a vector of n_light + n_dark + 1 colors.

Examples

1
2
3
4
create_single_scale(color = "#1D9A6C")

# display in viewer
view_cols(create_single_scale(color = "#1D9A6C"))

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