Jetpack compose offers many different animation helper functions. We can easily animate floats, colors, density-pixels, etc. These helper functions are usually called like this:
val animatedColor by animateColorAsState(
targetValue = color,
animationSpec = tween(durationMillis = 300, easing = LinearEasing)
)
The animateColorAsState function returns a state object and we can simply listen to this