distinctColors: Create a color palette

Description Usage Arguments Value Examples

View source: R/celda_functions.R

Description

Generate a palette of 'n' distinct colors.

Usage

1
2
3
4
5
6
distinctColors(
  n,
  hues = c("red", "cyan", "orange", "blue", "yellow", "purple", "green", "magenta"),
  saturationRange = c(0.7, 1),
  valueRange = c(0.7, 1)
)

Arguments

n

Integer. Number of colors to generate.

hues

Character vector. Colors available from 'colors()'. These will be used as the base colors for the clustering scheme in HSV. Different saturations and values will be generated for each hue. Default c("red", "cyan", "orange", "blue", "yellow", "purple", "green", "magenta").

saturationRange

Numeric vector. A vector of length 2 denoting the saturation for HSV. Values must be in [0,1]. Default: c(0.25, 1).

valueRange

Numeric vector. A vector of length 2 denoting the range of values for HSV. Values must be in [0,1]. Default: 'c(0.5, 1)'.

Value

A vector of distinct colors that have been converted to HEX from HSV.

Examples

1
colorPal <- distinctColors(6) # can be used in plotting functions

celda documentation built on June 9, 2020, 2 a.m.