colorOp: Simple Color Operations

View source: R/colorOps.R

colorOpR Documentation

Simple Color Operations

Description

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

colorOp(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.

Value

Color

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.