powered by
Produces an interpolation of two colours.
col_mix(a, b, amount = 0.5, space = "rgb")
A character vector of colours.
Either a character vector of colours or a colour palette function.
A numeric fraction between 0 and 1 giving the contribution of the b colour.
b
A string giving a colour space to perform mixing operation in. Polar spaces are not recommended.
Other colour manipulation: alpha(), col2hcl(), colour_manip, muted()
alpha()
col2hcl()
colour_manip
muted()
col_mix("blue", "red") # purple col_mix("blue", "red", amount = 1) # red col_mix("blue", "red", amount = 0) # blue # Not recommended: col_mix("blue", "red", space = "hcl") # green!
Run the code above in your browser using DataLab