meanColor | R Documentation |
Return the average color of a vector of colors, computed in the RGB space.
meanColor(colors)
colors |
a vector of colors |
Input colors can be either in html or color name formats. The alpha channel is supported but optional.
a single color value
redimMatrix
meanColor(c("#000000FF", "#FFFFFF00", "#FFFF00FF", "#FF0000FF"))
# works with color names
meanColor(c("blue", "red"))
# Mix color names and HTML codes
meanColor(c("blue", "red", "#FFFF00FF"))
# works without alpha channel in inputs (but outputs an alpha channel):
meanColor(c("#000000", "#FFFFFF", "#FFFF00", "#FF0000"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.