rgb_weighted_mean: Finds a color between those received as input in RGB palette

Description Usage Arguments Value Examples

Description

Finds a color between those received as input in RGB palette

Usage

1
2
rgb_weighted_mean(col1, col2, w1 = 0.5, smooth_factor = 2,
  output = "hex")

Arguments

col1

First color. Hexcode, c(r,g,b), color name as character and "color" class object are all supported.

col2

Second color. Hexcode, c(r,g,b), color name as character and "color" class object are all supported.

w1

Number between 0 and 1. Represents how similar the output will be to col1. Defaults to .5

smooth_factor

Correction to prevent mixtures from appearing too dark, making the palette more related to human perception of color. Defaults to 2

output

Format in which output will be returned. Use "hex" to get a hexcode. Use "color" for a "color" class object to be returned. Defaults to "hex"

w2

Number between 0 and 1. Represents how similar the output will be to col2. Defaults to 1-w1

Value

The corresponding hexcode or "color" class object.

Examples

1
2
 rgb_weighted_mean("red", "green", smooth_factor=1)
 rgb_weighted_mean("red", "green", smooth_factor=7000)

dpcarballo/coloR documentation built on June 1, 2019, 8:14 p.m.