powered by
pick_colors() places each color into RGB space, clusters them with k-means, and returns the colors nearest each cluster center.
pick_colors()
color_order() reorders colors so that subsequent colors are far from each other in RGB space.
color_order()
color_distance() calculates pairwise distances in RGB space between colors.
color_distance()
pick_colors(hex, n)color_distance(hex)color_order(hex)
color_distance(hex)
color_order(hex)
a character vector that is a subset of hex, or a matrix of distances for color_distance()
hex
a character vector of hexadecimal colors
the integer number of desired colors
pick_colors(crayons$standard, 10) color_order(crayons$standard) color_distance(crayons$standard[1:4])
Run the code above in your browser using DataLab