mixcolorr: Mix two "R" colors

View source: R/mixcolorr.R

mixcolorrR Documentation

Mix two "R" colors

Description

mixcolorr mixes two R color strings in a given proportion. It is a wrapper around colorspace::mixcolor() that accepts and returns R color strings like "red" or"#FF0000". It is vectorized.

Usage

mixcolorr(alpha, col1, col2, ...)

Arguments

alpha

A numeric vector of length 1 or n with values between 0 (only col1) and 1 (only col2) indicating the mixing coefficient.

col1

The first color to mix, as a name or hexadecimal code.

col2

The second color to mix, as a name or hexadecimal code.

...

other arguments passed to colorspace::mixcolor()

Value

A hexadecimal color code representing the mixed color.

See Also

colorspace::mixcolor() grDevices::colors() grDevices::col2rgb()

Examples

mixcolorr(0.8, "red", "gray")

jan-glx/schelpr documentation built on March 28, 2024, 1:35 a.m.