animateColorScheme

fun animateColorScheme(colorScheme: ColorScheme, animationSpec: AnimationSpec<Color> = defaultColorSpring, label: String = "ColorSchemeAnimation"): ColorScheme

Creates an animated version of a ColorScheme where all colors smoothly animate when changed.

This composable function creates a new ColorScheme where each color property will animate from its previous value to its new value whenever the input colorScheme changes.

Return

A new ColorScheme instance with animated color properties.

Parameters

colorScheme

The source color scheme to animate from/to.

animationSpec

The animation specification to control how each color animates.

label

A debugging label used to identify this animation.