adjust_rgb: Adjust a color's RGB components

Description Usage Arguments Value See Also Examples

Description

These functions adjust a color's red, green, and blue components

adjust_rgb adjusts red, green, and blue, either by replacing the current value (mode="absolute") or adding to it (mode="relative", the default).

Usage

1
adjust_rgb(col, r = NULL, g = NULL, b = NULL, mode = "relative")

Arguments

col

Vector containing any of the three kinds of R color specifications:

  1. a color name (see colors)

  2. a hexadecimal string of the form "#rrggbb" (see rgb)

  3. a positive integer i meaning palette()[i]

r

The adjustment in hue [-1,1] (default: NULL)

g

The adjustment in saturation [-1,1] (default: NULL)

b

The adjustment in brightness [-1,1] (default: NULL)

mode

Whether the adjustments set the value directly ("absolute") or are added to the current value ("relative", default).

Value

The adjusted color(s) as hexadecimal strings

See Also

red, green, blue, and alpha to get RGB component values

Examples

1
2
# Add red to purple
adjust_rgb("purple", r = 0.2)

briandconnelly/colormod documentation built on May 13, 2019, 5:13 a.m.