File: mixcolor.Rd

package info (click to toggle)
r-cran-colorspace 1.4-0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,588 kB
  • sloc: ansic: 1,206; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/colorspace.R
\name{mixcolor}
\alias{mixcolor}
\title{Compute the Convex Combination of Two Colors}
\usage{
mixcolor(alpha, color1, color2, where = class(color1))
}
\arguments{
\item{alpha}{The mixed color is obtained by combining an amount
\code{1 - alpha} of \code{color1} with an amount \code{alpha} of
\code{color2}.}

\item{color1}{The first color.}

\item{color2}{The second color.}

\item{where}{The color space where the mixing is to take place.}
}
\value{
The mixed color.  This is in the color space specified by
\code{where}.
}
\description{
This function can be used to compute the result of color mixing (it assumes
additive mixing).
}
\examples{
mixcolor(0.5, RGB(1, 0, 0), RGB(0, 1, 0))
}
\seealso{
\code{\link{RGB}}, \code{\link{HSV}}, \code{\link{XYZ}},
\code{\link{LAB}}, \code{\link{polarLAB}}, \code{\link{LUV}},
\code{\link{polarLUV}}.
}
\author{
Ross Ihaka
}
\keyword{color}