Inverts each colour's RGB channels (1 - channel), the classic
"photo negative" transform. Unlike color_rotate_hue(degrees = 180),
which keeps HSL saturation/lightness fixed and only flips hue, RGB
inversion also flips lightness (e.g. white inverts to black, not to
another light colour).
See also
Other color helpers:
color_alpha(),
color_greyscale(),
color_jitter(),
color_lighten(),
color_mix(),
color_rotate_hue(),
color_saturate()
Examples
color_invert("white")
#> [1] "#000000"
color_invert(palette_manual(index = 1))
#> [1] "#CC9A75" "#794427" "#D0B7A7" "#0951D2" "#0D9BE6"
draw(effect_swatch(color = color_invert(palette_manual(index = 1))))