View source: R/compute_blend.R
blend | R Documentation |
Blend two colors using RGB channel-wise blend functions.
blend(x, y, mode = "multiply")
x, y |
colors specified as hex strings or named R colors. |
mode |
blending mode; valid modes are |
All arguments can be vectors, as long as they are of compatible length (shorter arguments will be repeated to the length of longer arguments)
A vector of colors specified as hex codes
Other color manipulation functions:
average()
,
channel()
,
darken()
,
luminance()
,
mix()
,
saturate()
blend("#4CBBFC", "#EEEE22") # Arguments can be vectors and all blends are returned mix("red", c("blue", "darkblue", "lightblue")) #' Show the effects of the various blend modes all_blends <- function(x, y) { c(x, y, "white", blend(x, y, mode=c("multiply", "darken", "lighten", "screen", "overlay", "burn", "dodge")) ) } show_col( all_blends("#FEF213", "#146EFD"), all_blends("#146EFD", "#FEF213"), all_blends("#FEF213", "#FA000C"), all_blends("#FA000C", "#FEF213"), all_blends("#146EFD", "#FA000C"), all_blends("#FA000C", "#146EFD") ) # NB: for some blending modes, the order of the input colors is important
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.