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.
addmix(base, mixer, amount = 1, space = NULL)submix(base, mixer, amount = 1, space = NULL)
X %.)% Y
X %_/% Y
A vector of base colours, or a palette function or scale.
A vector of colours to mix in.
The amount of each colour to mix in, relative to the amount
of the base. This will be recycled to the length of mixer
.
A string giving the space in which to perform the mixing, or
NULL
. In the latter case, the space of base
will be used.
New colours of class "shade"
, or a new palette function.
# NOT RUN {
addmix(c("red","green","blue"), "red")
submix(c("cyan","magenta","yellow"), "cyan")
# }
Run the code above in your browser using DataLab