themeColors

fun ImageBitmap.themeColors(maxColors: Int = DEFAULT_QUANTIZE_MAX_COLORS, fallback: Color = Color(-0xbd7a0c), filter: Boolean = true, desired: Int = DEFAULT_DESIRED_COLORS): List<Color>

Rank the colors in a ImageBitmap by their suitability for being used for a UI theme.

Receiver

the ImageBitmap to extract colors from.

Return

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.

Parameters

maxColors

The number of colors to divide the image into.

fallback

color to be returned if no other options available.

filter

whether to filter out undesirable combinations.

desired

The number of colors to return.