DominantColorState

constructor(defaultColor: Color, defaultOnColor: Color, cacheSize: Int = DEFAULT_CACHE_SIZE, coroutineContext: CoroutineContext = Dispatchers.Default, isSwatchValid: (Palette.Swatch) -> Boolean = { true }, builder: Palette.Builder.() -> Unit = {})

Parameters

T

The type of the input to calculate the dominant color from.

defaultColor

The default color, which will be used if calculateDominantColor fails to calculate a dominant color

cacheSize

The size of the LruCache used to store recent results. Pass 0 to disable the cache.

coroutineContext

The CoroutineContext used to launch the coroutine.

builder

A lambda which allows customization of the Palette.Builder used to generate the Palette from the input T