lerp the artwork theme every frame instead of 24 quantized steps

This commit is contained in:
austinried
2026-10-04 00:30:05 +00:00
parent 430d2cf104
commit afbbe29d6f
@@ -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) }
}