diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt index c35a38f2..8028cd0d 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt @@ -116,6 +116,8 @@ internal fun FeaturedSection( systemBarsEndPadding } + val defaultSeedColor = AppTheme.colorScheme.tintedForeground + LaunchedEffect(pagerState, featuredPosts) { snapshotFlow { val settledPage = pagerState.settledPage @@ -148,9 +150,14 @@ internal fun FeaturedSection( currentItem } + val fromSeedColor = + fromItem.seedColor.run { if (this != null) Color(this) else defaultSeedColor } + val toSeedColor = + toItem.seedColor.run { if (this != null) Color(this) else defaultSeedColor } + dynamicColorState.animate( - fromSeedColor = Color(fromItem.seedColor!!), - toSeedColor = Color(toItem.seedColor!!), + fromSeedColor = fromSeedColor, + toSeedColor = toSeedColor, progress = offset ) }