Score

object Score

Given a large set of colors, remove colors that are unsuitable for a UI theme, and rank the rest based on suitability.

Enables use of a high cluster count for image quantization, thus ensuring colors aren't muddied, while curating the high cluster count to a much smaller number of appropriate choices.

Functions

Link copied to clipboard
fun score(colorsToPopulation: Map<Int, Int>, desired: Int = 4, fallbackColorArgb: Int? = -0xbd7a0c, filter: Boolean = true): List<Int>

Given a map with keys of colors and values of how often the color appears, rank the colors based on suitability for being used for a UI theme.