invert_color: Invert color(s)

Description Usage Arguments Value Examples

View source: R/dark_mode.R

Description

Invert a vector of colors, provided the colors are valid hex codes or have valid names (i.e., they belong to base::colors()), and return a vector of inverted colors in hex code.

Usage

1
2
3
invert_color(color, colour = color)

invert_colour(color, colour = color)

Arguments

color

color(s) to invert

colour

alias of color

Value

Inverted color(s) in hex code

Examples

1
2
3
4
invert_color("white")    # "black"
invert_color("gray20")   # "gray80"
invert_color("grey80")   # "grey20"
invert_color(c("#000000", "#333333"))  # "#FFFFFF","#CCCCCC"

ggdark documentation built on May 2, 2019, 3:43 p.m.