hsv_weighted_mean: Finds a color between those received as input in HSV palette

Description Usage Arguments Value Examples

Description

Finds a color between those received as input in HSV palette

Usage

1
hsv_weighted_mean(col1, col2, w1 = 0.5, w2 = 1 - w1, 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

w2

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

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"

Value

A hexcode (or "class" color object) built as commanded.

Examples

1
2
3
4
5
hsv_weighted_mean("red", "green", output="color")
hsv_weighted_mean("red", "green")
hsv_weighted_mean("blue", "red", w1=5/6)
hsv_weighted_mean(c(0,0,0), color("white"))
hsv_weighted_mean("#000000", "red")

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