color.shades: create color shades

Description Usage Arguments Details Value Author(s) Examples

View source: R/clusterluts.R

Description

For each color in col create as many shades as indicated by the value of reps at the corresponding index by grading towards 'white' - the shades are going scale of the way to white/black.

Usage

1
2
3
4
5
6
7
8
9
color.shades(
  reps,
  col = col.fun(length(reps)),
  scale = ifelse(direction == "bright", 0.7, 0.5),
  gscale = TRUE,
  direction = c("all", "bright", "dark"),
  col.fun = default.hcl,
  ...
)

Arguments

reps

vector of repetitions

col

color vector; must be a valid argument to col2rgb or a 3xN RGB color matrix (one column per color). see description

scale

how much of the range to black/white should be covered

gscale

global shade steps?

direction

which way to build the shades, see Description

col.fun

function to calculate default colors

...

passed to ColorShadeRamp

Details

If col is provided and reps is scalar it is recycled to the length of col, otherwise it is filled with ones should it be shorter than col.

The shades can be constructed either towards white, black, or, symmetrically. This is determined by setting direction to 'bright', 'dark', or 'all', respectively. The latter is the default. When gscale is TRUE, all shade steps are the same, independent of the individual repetitions, otherwise each shade range covers the range given by scale.

Value

Color matrix with on entry per column

Author(s)

Benno Pütz puetz@psych.mpg.de

Examples

1
2
color.shades(3, c('red', 'blue'))
show.shades(color.shades(2:4, c('red', 'green', 'blue')))

bennop/clusterLUTs documentation built on Nov. 21, 2020, 9:07 a.m.