rememberNetworkDominantColorState
fun rememberNetworkDominantColorState(defaultColor: Color, defaultOnColor: Color, cacheSize: Int = DominantColorState.DEFAULT_CACHE_SIZE, httpClient: HttpClient = HttpClient(), httpRequestBuilder: HttpRequestBuilder = HttpRequestBuilder(), coroutineContext: CoroutineContext = Dispatchers.Default, isSwatchValid: (Palette.Swatch) -> Boolean = { true }, builder: Palette.Builder.() -> Unit = {}): DominantColorState<Url>
Wrapper around rememberDominantColorState that uses NetworkLoader to load the image.
You must import the Ktor client library to use this loader.
Return
A DominantColorState which can be used to generate a dominant color from a ImageBitmap.
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.
httpClient
The HttpClient used to load the image.
httpRequestBuilder
The HttpRequestBuilder used to load the image.
coroutineContext
The CoroutineContext used to launch the coroutine.
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.