Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mixcolor

Compute the Convex Combination of Two Colors


Description

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

Usage

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

Examples

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

colorspace

A Toolbox for Manipulating and Assessing Colors and Palettes

v2.0-1
BSD_3_clause + file LICENSE
Authors
Ross Ihaka [aut], Paul Murrell [aut] (<https://orcid.org/0000-0002-3224-8858>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), Jason C. Fisher [aut] (<https://orcid.org/0000-0001-9032-8912>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>), Claus O. Wilke [aut] (<https://orcid.org/0000-0002-7470-9261>), Claire D. McWhite [aut] (<https://orcid.org/0000-0001-7346-3047>), Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>)
Initial release
2021-05-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.