powered by
This ensures all colors are distinct by packing the (visible part) of the CIELAB color space with the needed number of spheres, and using their centers to generate the colors.
distinct_colors( n, minimal_saturation = 33, minimal_lightness = 20, maximal_lightness = 80 )
A list with two elements, name containing the color names and lab
name
lab
containing a matrix with a row per color and three columns containing the l,
l
a and b coordinates of each color.
a
b
The requested (positive) number of colors.
Exclude colors whose saturation (hypot(a, b) in CIELAB color space) is less than this value (by default, 33).
hypot(a, b)
Exclude colors whose lightnes (l in CIELAB color space) is less than this value (by default, 20).
Exclude colors whose lightnes (l in CIELAB color space) is more than this value (by default, 80).
chameleon::distinct_colors(8)
Run the code above in your browser using DataLab