Skip to contents

Mix two colors

Usage

mixcolor(x, y, frac = 0.5, alpha = 1)

Arguments

x, y

Colors (anything accepted by col2rgb())

frac

Mixing fraction, proportion of x (default: 0.5)

alpha

Transparency (default: 1)

Examples

mixcolor('#008DFFFF', 'white')
#> [1] "#7FC6FFFF"
mixcolor('#008DFFFF', 'white', frac=0.9)
#> [1] "#1998FFFF"
mixcolor('#008DFFFF', 'white', alpha=0.2)
#> [1] "#7FC6FF33"