-
-
Save skydoves/1d28241bd6c468cc3507a44bfc7d5a25 to your computer and use it in GitHub Desktop.
Palette
This file contains 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
var palette by remember { mutableStateOf<Palette?>(null) } | |
GlideImage( // CoilImage, FrescoImage also can be used. | |
imageModel = poster?.poster!!, | |
bitmapPalette = BitmapPalette { | |
palette = it | |
} | |
) | |
Crossfade( | |
targetState = palette, | |
modifier = Modifier | |
.padding(horizontal = 8.dp) | |
.size(45.dp) | |
) { | |
Box( | |
modifier = Modifier | |
.background(color = Color(it?.lightVibrantSwatch?.rgb ?: 0)) | |
.fillMaxSize() | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment