distinct_colors: 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
distinct_colors(n, hues = c("red", "cyan", "orange", "blue", "yellow",
  "purple", "green", "magenta"), saturation.range = c(0.7, 1),
  value.range = 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").

saturation.range

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

value.range

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
color.pal = distinct_colors(6)  # can be used in plotting functions

compbiomed/celda documentation built on May 25, 2019, 3:58 a.m.