Created
March 28, 2026 01:14
-
-
Save skydoves/d66a17c8ae2b9cbc292cde4660959b09 to your computer and use it in GitHub Desktop.
PalettePlugin compose function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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