invertColor: Invert A Color to Its Conplementary Color

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Invert A Color to Its Conplementary Color

Usage

1
2
invertColor(color, mode = c("bw", "opposite", "hue", "saturation",
  "lumination", ""), ...)

Arguments

color

A hex or named color, or color in 'rgba(R, G, B, A)' string.

mode

One or a vector of modes combined. You can only input the first letter. Default 'bw', which is most useful in textStyles.

bw

black and white invertion

opposite

complete invertion to get an opposite color

hue

only invert hue in terms of hsv

saturation

only invert saturation in terms of hsv

lumination

only invert lumination in terms of hsv

...

Elipsis

Value

Inverted hex color

See Also

hsv, rgb2hsv, rgb,

Examples

1
2
3
4
5
6
col = sapply(list('o', 'h', 'l', 's', 'b', c('h', 'l'), c('h', 's'),
              c('l', 's'), c('h', 's', 'l')), function(mode) {
              return(invertColor('darkred', mode))
        })
library(scales)
show_col(c('darkred', unlist(col)))

madlogos/recharts2 documentation built on May 21, 2019, 11:03 a.m.