toAnimation

@Composable
fun Keyframes.toAnimation(    duration: CSSTimeNumericValue? = null,     timingFunction: AnimationTimingFunction? = null,     delay: CSSTimeNumericValue? = null,     iterationCount: AnimationIterationCount? = null,     direction: AnimationDirection? = null,     fillMode: AnimationFillMode? = null,     playState: AnimationPlayState? = null): Animation.Repeatable(source)

A convenience method to convert this Keyframes instance into an object that can be passed into Modifier.animation.

This version of the method is Composable because it's aware of the site's current color mode.

See also


fun Keyframes.toAnimation(    colorMode: ColorMode?,     duration: CSSTimeNumericValue? = null,     timingFunction: AnimationTimingFunction? = null,     delay: CSSTimeNumericValue? = null,     iterationCount: AnimationIterationCount? = null,     direction: AnimationDirection? = null,     fillMode: AnimationFillMode? = null,     playState: AnimationPlayState? = null): Animation.Repeatable(source)

A convenience method to convert this Keyframes instance into an object that can be passed into Modifier.animation.

This version of the method is not Composable and requires the user pass in a ColorMode explicitly, especially to distinguish it from the other toAnimation method.

If you defined a Keyframes that uses references the site's color mode, it is an error if you pass in colorMode is null. Alternately, if the Keyframes doesn't reference the site's color mode in its definition, then whatever color mode is passed in is ignored.

It can be useful to call this method from within a CssStyle. For example:

val MyAnimatedStyle = CssStyle {
  after {
    Modifier.animation(AnimOut.toAnimation(colorMode, ...))
  }
}