distant_colors: Palettes of dissimilar colors in RGB space.
Description
Many standard palette generators use only a slice of color space, which can
cause a lack of differentiability in palettes used to visualize categorical
factors with many levels. This function attempts to overcome this by
generating colors using nearest-neighbor distance maximization in 3D RGB
space.
Usage
distant_colors(
n,
res = 20,
maxreps = 1000,
radius = 10,
avoid_white = TRUE,
seed = NULL
)
Value
Character vector of colors.
Arguments
n
Number of colors (integer).
res
Number of distinct values in each RGB dimension (integer).
maxreps
Max number of optimization iterations (integer).
radius
Neighborhood size for potential moves, analagous to heating.
avoid_white
Logical, default is TRUE.
seed
Integer used to seed randomization during search; leave as NULL to generate different results each time, or set a value to generate reproducible results.