randcolours: Random colours

Description Usage Arguments Details Examples

View source: R/randcolours.R

Description

Generate a randomly selected colour palette

Usage

1
2
randcolours(n, l = c(0.2, 0.9), c1 = c(0, 1), c2 = c(0, 1),
  alpha = 1, space = c("Luv", "Lab"))

Arguments

n

number of colours

l

lightness range

c1

colour channel one range

c2

colour channel two range

alpha

alpha channel range

space

should the parameters be interpreted as Luv or Lab components?

Details

The range of l, c1, c2 and alpha, will be interpreted as the wanted range of each colour component, whether their length is 1, 2, or more. Although they all should nominally lie within [0, 1], only alpha must do so to achieve a valid output. The others can exeed this range, at an icreased risk of clipping.

Examples

1
2
3
set.seed(3)
n <- 20
plot(1:n, col=randcolours(n), pch=16, cex=5)

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.