Invert a color or calculate the mean of two colors in HSV or RGB space.
This may be useful in creating colors for plots
Usage
color_op(col, fn = c("invert", "mean"), space = c("HSV", "RGB"))
Arguments
- col
Input color(s)
- fn
Character: "invert", "mean": Function to perform
- space
Character: "HSV", "RGB": Colorspace to operate in - for
averaging only
Details
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.