clr_negate: Negates colors in RGB space

View source: R/negate.R

clr_negateR Documentation

Negates colors in RGB space

Description

Negates colors in RGB space

Usage

clr_negate(col)

Arguments

col

a color object or vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

Details

The negation of color is happening in the red-green-blue colorspace RGB. Meaning that if we take the specification for Orange which is rgb(255, 165, 0), then we negate by taking the oppesite number on the scale from 0 to 255, leaving us with rgb(0, 90, 255) which is a shade of blue.

Value

a colors object of same length as col.

Examples

terr <- color(terrain.colors(10))

terr
clr_negate(terr)

plot(terr)
plot(clr_negate(terr))

EmilHvitfeldt/prismatic documentation built on April 15, 2024, 3:24 p.m.