Apply tint to a provided color

tint_color(x, tint)

Arguments

x

either a color name (as listed by colors()), a hexadecimal string

tint

the percentage to tint the color. Must be a value between 0 and 1

Value

A hexadecimal color string representing the tinted color.

Examples

tint_color("blue", tint = .5)
#> [1] "#7F7FFF"
tint_color("#0000FF", tint = .5)
#> [1] "#7F7FFF"