average_colors: Determine the numerical average of a vector of colors

View source: R/average_colors.R

average_colorsR Documentation

Determine the numerical average of a vector of colors

Description

Convert a vector of colors into a single color that averages their numerical values of RGB (red-green-blue) or Lab (lightness-a-b) characteristics.

Usage

average_colors(x, method="RGB")

Arguments

x

vector of color names to average

method

character, specificying the color space in which to average. Currently only "RGB" is accepted.

Details

Solution derived from answer by stackoverflow user Deleplace at https://stackoverflow.com/questions/14482226/how-can-i-get-the-color-halfway-between-two-colors

Value

character, the hexadecimal representation of the color


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.