average_color: Get the average hex color from a list of colors

Description Usage Arguments Value

View source: R/utils.R

Description

First the average hue is calculated by averaging r, g and b components of the colors and converted to HSL. Then, this hue is combined with average s and l in order to avoid muddy colors. Finally, the combined HSV is converted to hex.

Usage

1
average_color(color_names)

Arguments

color_names

Vector of color names (from [grDevices::colors()]).

Value

Average color in hex form.


martina-starc/peRson documentation built on April 14, 2021, 3:48 p.m.