trim_palette: Try to intelligently reduce a large palette down to a...

View source: R/trim-palette.R

trim_paletteR Documentation

Try to intelligently reduce a large palette down to a reasonable smaller set of colors

Description

Given a palette and a desired number of colors to use, this function will compute CIEDE2000 and attempt to reduce the input set to a disctinct smaller set of colors based on color distances.

Usage

trim_palette(pal, n = 5)

Arguments

pal

input palette to reduct

n

number of desired colors

Value

vector of n colors from pal

Note

internal CIEDE2000 color distance implementation by Gaurav Sharma & Maynard P Baalthazar


hrbrmstr/swatches documentation built on April 8, 2022, 3:59 p.m.