rememberDrawableDominantColorState
fun rememberDrawableDominantColorState(defaultColor: Color, defaultOnColor: Color, cacheSize: Int = DEFAULT_CACHE_SIZE, coroutineContext: CoroutineContext = Dispatchers.Default, context: Context = LocalContext.current, isSwatchValid: (Palette.Swatch) -> Boolean = { true }, builder: Palette.Builder.() -> Unit = {}): DominantColorState<Int>
Wrapper around rememberDominantColorState that uses com.kmpalette.loader.DrawableLoader to load the image.
Return
A DominantColorState which can be used to generate a dominant color from a DrawableResource.
Parameters
defaultColor
The default color, which will be used if Palette.generate fails.
defaultOnColor
The default color to use on defaultColor.
cacheSize
The size of the LruCache used to store recent results. Pass 0 to disable.
coroutineContext
The CoroutineContext used to launch the coroutine.
context
The Context to use for loading drawables.
isSwatchValid
A lambda which allows filtering of the calculated Palette.Swatch.
builder
A lambda which allows customization of the Palette.Builder used to generate the Palette.