colorOp | R Documentation |
Invert a color or calculate the mean of two colors in HSV or RGB space. This may be useful in creating colors for plots
colorOp(col, fn = c("invert", "mean"), space = c("HSV", "RGB"))
col |
Input color(s) |
fn |
Character: "invert", "mean": Function to perform |
space |
Character: "HSV", "RGB": Colorspace to operate in - for averaging only |
The average of two colors in RGB space will often pass through gray, which is likely undesirable. Averaging in HSV space, better for most applications.
Color
E.D. Gennatas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.