generatePalette
suspend fun ImageBitmap.generatePalette(coroutineContext: CoroutineContext = Dispatchers.Default, block: Palette.Builder.() -> Unit = {}): Palette
Generates a Palette from this ImageBitmap.
This suspend function extracts colors from the bitmap and generates a palette asynchronously on the specified coroutine context.
Return
The generated Palette containing color swatches extracted from the bitmap.
Parameters
coroutineContext
The CoroutineContext to use for palette generation. Defaults to Dispatchers.Default.
block
Optional lambda to configure the Palette.Builder before generation.