mixtures: Colour mixtures

Description Usage Arguments Value Author(s) Examples

Description

These functions allow colours to be mixed in any colour space, either additively (like light) or subtractively (like paint). The infix form %.)% is an alternative for addmix, and %_/% for submix, with the mixing amount being fixed to 1 in these cases.

Usage

1
2
3
4
5
6
7
addmix(base, mixer, amount = 1, space = NULL)

submix(base, mixer, amount = 1, space = NULL)

X %.)% Y

X %_/% Y

Arguments

base, X

A vector of base colours, or a palette function or scale.

mixer, Y

A vector of colours to mix in.

amount

The amount of each colour to mix in, relative to the amount of the base. This will be recycled to the length of mixer.

space

A string giving the space in which to perform the mixing, or NULL. In the latter case, the space of base will be used.

Value

New colours of class "shade", or a new palette function.

Author(s)

Jon Clayden <code@clayden.org>

Examples

1
2
addmix(c("red","green","blue"), "red")
submix(c("cyan","magenta","yellow"), "cyan")

shades documentation built on Aug. 2, 2019, 5:05 p.m.