meanColor: meanColor

View source: R/meanColor.R

meanColorR Documentation

meanColor

Description

Return the average color of a vector of colors, computed in the RGB space.

Usage

meanColor(colors)

Arguments

colors

a vector of colors

Details

Input colors can be either in html or color name formats. The alpha channel is supported but optional.

Value

a single color value

See Also

redimMatrix

Examples

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"))

GenEpi-GenPhySE/epistack documentation built on July 27, 2023, 1:09 a.m.