clr_mix: Mixes a color into

Description Usage Arguments Value Examples

View source: R/mix.R

Description

Mixes a color into

Usage

1
clr_mix(col, mix_in, ratio = 0.5)

Arguments

col

a color object or vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

mix_in

A single color any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

ratio

Numeric between 0 and 1. 0 will result on no mixing. 1 results in all the colors turning to mix_in. Must be of length 1 or same length as col.

Value

a colors object

Examples

1
2
3
4
5
6
7
plot(clr_mix(rainbow(10), "blue"))

plot(clr_mix(rainbow(10), "red"))

plot(clr_mix(rainbow(10), "#5500EE"))

plot(clr_mix(rainbow(10), "black", seq(1, 0, length.out = 10)))

prismatic documentation built on Oct. 17, 2021, 9:06 a.m.