| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/max_chroma.R |
| 3 |
\docType{data} |
| 4 |
\name{max_chroma} |
| 5 |
\alias{max_chroma} |
| 6 |
\alias{max_chroma_table} |
| 7 |
\title{Compute Maximum Chroma for Given Hue and Luminance in HCL} |
| 8 |
\usage{ |
| 9 |
max_chroma(h, l, floor = FALSE) |
| 10 |
|
| 11 |
max_chroma_table |
| 12 |
} |
| 13 |
\arguments{ |
| 14 |
\item{h}{hue value in the HCL color description, has to be in [0, 360].} |
| 15 |
|
| 16 |
\item{l}{luminance value in the HCL color description, has to be in [0, 100].} |
| 17 |
|
| 18 |
\item{floor}{logical. Should the chroma value be rounded down to the next |
| 19 |
lower integer?} |
| 20 |
} |
| 21 |
\value{ |
| 22 |
A numeric vector with the maximum chroma coordinates. |
| 23 |
} |
| 24 |
\description{ |
| 25 |
Compute approximately the maximum chroma possible for a given hue and |
| 26 |
luminance combination in the HCL color space. |
| 27 |
} |
| 28 |
\details{ |
| 29 |
As the possible combinations of chroma and luminance depend on hue, it is |
| 30 |
not obvious which maximum chroma can be used for a given combination of hue |
| 31 |
and luminance prior to calling \code{\link{polarLUV}}. To avoid having to |
| 32 |
\code{fixup} the color upon conversion to RGB \code{\link{hex}} codes, the |
| 33 |
\code{max_chroma} function computes (approximately) the maximum chroma |
| 34 |
possible. The computations are based on interpolations of pre-computed |
| 35 |
maxima in \code{max_chroma_table}, containing the maximum chroma for a given |
| 36 |
hue-luminance combination (both in integers). Hence, the result may sometimes |
| 37 |
still be very slightly larger than the actual maximum which can be avoided |
| 38 |
by taking the \code{floor} of the approximate value. |
| 39 |
} |
| 40 |
\examples{ |
| 41 |
max_chroma(h = 0:36 * 10, l = 50) |
| 42 |
max_chroma(h = 120, l = 0:10 * 10) |
| 43 |
} |
| 44 |
\seealso{ |
| 45 |
\code{\link[colorspace]{polarLUV}}, \code{\link[colorspace]{hex}} |
| 46 |
} |
| 47 |
\keyword{color} |
| 48 |
\keyword{datasets} |