color_gradient: Creates colors in a gradient between those received as input.

Description Usage Arguments Value Examples

Description

Creates colors in a gradient between those received as input.

Usage

1
2
color_gradient(..., steps = 1, smooth_factor = 2, method = "hsv",
  output = "hex")

Arguments

...

Colors that the user wants to belong to the gradient. Hexcode, c(r,g,b), color name as character and "color" class object are all supported. Inputting all of them as a list is also allowed

steps

Number of intermeddiate colors between those specified by the user

smooth_factor

Parameter smooth_factor hor rgb_weighted_mean call. Defaults to 2

method

Procedure to create the gradient. "hsv" and "rgb" are accepted as options. Defaults to "hsv

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

By default, character version containing hexcodes for every color belonging in the gradient. Using "color" as output, a list of class "color" objects representing the gradient

Examples

1
2
3
color_gradient("black", "red", "white", steps=3, method="rgb")
color_gradient("red", "green", "blue")
color_gradient("black","white", steps=11)

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