View source: R/color_compHist.R
mix.color | R Documentation |
Combine colors to generate a new color
mix.color(color, type = 2, alpha = 1)
color |
CHARACTER. color vector e.g see example |
type |
NUMERIC. return type of the output |
alpha |
NUMERIC. alpha or opacity of the resulting color |
hex for the combined color
# color vector
colvec <- c("red", "blue", "violet", "green", "#ff0066")
# just one color
mix.color(colvec[1], type = 1, alpha = 1)
# add two colors
mix.color(colvec[1:2], type = 1, alpha = 1)
# add three colors
mix.color(colvec[1:3], type = 1, alpha = 1)
# return type = 2
# just one color
mix.color(colvec[1], type = 2, alpha = 1)
# add two colors
mix.color(colvec[1:2], type = 2, alpha = 1)
# add three colors
mix.color(colvec[1:3], type = 2, alpha = 1)
# opacity or alpha 0.5
# just one color
mix.color(colvec[1], type = 1, alpha = 0.5)
# add two colors
mix.color(colvec[1:2], type = 1, alpha = 0.5)
# add three colors
mix.color(colvec[1:3], type = 1, alpha = 0.5)
# add all colors
mix.color(colvec, type = 1, alpha = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.