From 6545764bd1269dc52111093dc79d6f53eed02562 Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 13 Apr 2024 11:53:34 +0900 Subject: [PATCH] Return apply if the local inspection mode is true on the palette plugin --- .../kotlin/com/skydoves/landscapist/palette/PalettePlugin.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/landscapist-palette/src/commonMain/kotlin/com/skydoves/landscapist/palette/PalettePlugin.kt b/landscapist-palette/src/commonMain/kotlin/com/skydoves/landscapist/palette/PalettePlugin.kt index 48188417..66cef1e4 100644 --- a/landscapist-palette/src/commonMain/kotlin/com/skydoves/landscapist/palette/PalettePlugin.kt +++ b/landscapist-palette/src/commonMain/kotlin/com/skydoves/landscapist/palette/PalettePlugin.kt @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ImageBitmap +import androidx.compose.ui.platform.LocalInspectionMode import com.skydoves.landscapist.ImageOptions import com.skydoves.landscapist.plugins.ImagePlugin @@ -53,6 +54,8 @@ public data class PalettePlugin( imageBitmap: ImageBitmap?, ): ImagePlugin = apply { + if (LocalInspectionMode.current) return@apply + imageBitmap?.let { bitmapPalette.applyImageModel(this.imageModel ?: imageModel) bitmapPalette.generate(it)