Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created March 28, 2026 01:14
Show Gist options
  • Select an option

  • Save skydoves/d66a17c8ae2b9cbc292cde4660959b09 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/d66a17c8ae2b9cbc292cde4660959b09 to your computer and use it in GitHub Desktop.
PalettePlugin compose function
@Composable
override fun compose(
modifier: Modifier,
imageModel: Any?,
imageOptions: ImageOptions,
imageBitmap: ImageBitmap?,
): ImagePlugin =
apply {
if (LocalInspectionMode.current) return@apply
imageBitmap?.let {
bitmapPalette.applyImageModel(this.imageModel ?: imageModel)
bitmapPalette.generate(it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment