Class Score
java.lang.Object
org.glavo.monetfx.internal.score.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.
-
Method Summary
Modifier and TypeMethodDescriptionGiven 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.
-
Method Details
-
score
-
score
public static List<Integer> score(Map<Integer, Integer> colorsToPopulation, int desired, int fallbackColorArgb, boolean filter) 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.- Parameters:
colorsToPopulation- map with keys of colors and values of how often the color appears, usually from a source image.desired- max count of colors to be returned in the list.fallbackColorArgb- color to be returned if no other options available.filter- whether to filter out undesireable combinations.- Returns:
- Colors sorted by suitability for a UI theme. The most suitable color is the first item, the least suitable is the last. There will always be at least one color returned. If all the input colors were not suitable for a theme, a default fallback color will be provided, Google Blue.
-