mixcolor: Compute the Convex Combination of Two Colors

Description Usage Arguments Value Author(s) See Also Examples

View source: R/colorspace.R

Description

This function can be used to compute the result of color mixing (it assumes additive mixing).

Usage

1
mixcolor(alpha, color1, color2, where = class(color1))

Arguments

alpha

The mixed color is obtained by combining an amount 1 - alpha of color1 with an amount alpha of color2.

color1

The first color.

color2

The second color.

where

The color space where the mixing is to take place.

Value

The mixed color. This is in the color space specified by where.

Author(s)

Ross Ihaka

See Also

RGB, HSV, XYZ, LAB, polarLAB, LUV, polarLUV.

Examples

1
mixcolor(0.5, RGB(1, 0, 0), RGB(0, 1, 0))

colorspace documentation built on May 2, 2019, 12:49 p.m.