Learn R Programming

DiagrammeR (version 0.8.1)

roll_palette: Create a simple color palette

Description

Generate a randomized set of colors from the CIE Lab color space using a set of HCL range values.

Usage

roll_palette(number, hue_range = c(0, 360), chroma_range = c(0, 3),
  lightness_range = c(0.75, 1.5), alpha = NULL)

Arguments

number
the number of colors to include in the palette.
hue_range
a vector representing a range of hues from 0 to 360.
chroma_range
a vector representing a range of chroma values from 0 to 3.
lightness_range
a vector representing a range of lightness values from 0 to 2.
alpha
an optional alpha value in the range of 0-100 to append to the hexadecimal color values.

Value

  • a vector of hexadecimal color values.

Examples

Run this code
# Create a palette of 12 colors
roll_palette(number = 12,
             hue_range = c(0, 360),
             chroma_range = c(0, 3),
             lightness_range = c(0.75, 1.5),
             alpha = NULL,
             display_colors = TRUE)

#> [1] "#F7DC9D" "#D937E5" "#8880B9" "#119F35" "#7CEAB7"
#> [6] "#F8877D" "#C08B1B" "#B1E2F9" "#8E9573" "#74A31C"
#> [11] "#51A053" "#50C9A4"

Run the code above in your browser using DataLab