| mix_col | R Documentation |
mix_col() simulates subtractive (pigment) color mixing by converting
input colors to Munsell notation via aqp::col2Munsell(), mixing them with
aqp::mixMunsell(), and converting the result back to an R color string
via aqp::parseMunsell().
mix_col(..., w = NULL, mixingMethod = "adaptive")
... |
Colors to mix. Can be individual color strings or character vectors; all are combined into a single vector. |
w |
A numeric vector of weights or proportions the same length as the combined color vector. Defaults to equal weights. |
mixingMethod |
Mixing method passed to |
A single R color string in hex notation.
mean_col() for a simpler quadratic-mean RGB approach (no extra packages required).
should_run_ex <- requireNamespace("aqp", quietly = TRUE) &&
(interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true"))
if (should_run_ex) {
mix_col(c("red", "blue"))
}
if (should_run_ex) {
mix_col("red", "yellow", "blue", w = c(2, 1, 1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.