animate

fun Color.animate(animationSpec: AnimationSpec<Color> = defaultColorSpring, label: String = "ColorAnimation", finishedListener: (Color) -> Unit? = null): State<Color>

Animate the color over time, allowing for a smooth transition between different color states.

Receiver

The Color to animate.

Return

A State object representing the animated color.

Parameters

animationSpec

The AnimationSpec to use for the animation.

label

A label to identify the animation.

finishedListener

A callback to invoke when the animation finishes.