From afbbe29d6fcb5c131cfc5b125cd7f61b2858ed0e Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 29 Sep 2026 08:25:50 +0000 Subject: [PATCH] lerp the artwork theme every frame instead of 24 quantized steps --- .../kotlin/com/subtracks/ui/theme/AnimatedArtworkColors.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/subtracks/ui/theme/AnimatedArtworkColors.kt b/app/src/main/kotlin/com/subtracks/ui/theme/AnimatedArtworkColors.kt index a6020c08..73306967 100644 --- a/app/src/main/kotlin/com/subtracks/ui/theme/AnimatedArtworkColors.kt +++ b/app/src/main/kotlin/com/subtracks/ui/theme/AnimatedArtworkColors.kt @@ -12,12 +12,9 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberUpdatedState import androidx.compose.runtime.setValue import androidx.compose.ui.graphics.lerp -import kotlin.math.roundToInt const val ARTWORK_THEME_TRANSITION_MS = 600 -private const val TRANSITION_STEPS = 24 - @Composable internal fun baseArtworkColors(): ArtworkColors { val scheme = MaterialTheme.colorScheme @@ -61,7 +58,7 @@ fun rememberAnimatedArtworkColors( } if (from === to) return to - val fraction = (progress.value * TRANSITION_STEPS).roundToInt() / TRANSITION_STEPS.toFloat() + val fraction = progress.value return remember(from, to, fraction) { lerpArtworkColors(from, to, fraction) } }