View source: R/compute_complement.R
complement | R Documentation |
Compute the complement color
complement(x, mode = "ryb")
x |
vector of colors specified as hex strings or named R colors. |
mode |
color mode to use, either "ryb" which yields the natural, paint-like complement, or "rgb" |
A vector of colors specified as hex codes
# paint-like complements
a <- c("red", "yellow", "blue")
b <- c("green", "purple", "orange")
w <- c("white", "white", "white")
show_col(a, complement(a), b, w, b, complement(b), a)
# scren-like complements
show_col(a, complement(a, mode="ryb"))
show_col(a, complement(a, mode="rgb"))
x <- c("red", "green", "blue", "cyan", "magenta", "yellow")
show_col(x, complement(x, mode="rgb"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.