https://kotlinlang.org logo
#compose
Title
# compose
x

xxfast

05/16/2022, 1:44 AM
is
animateColorBetween()
only available in compose >1.2?
b

Ben Trengrove [G]

05/16/2022, 1:50 AM
It's not a real function, we just used it as an example
Here you go though
Copy code
@Composable
fun animateColorBetween(start: Color, end: Color): State<Color> {
    val infiniteTransition = rememberInfiniteTransition()
    return infiniteTransition.animateColor(
        initialValue = start,
        targetValue = end,
        animationSpec = infiniteRepeatable(
            animation = tween(1000, easing = LinearOutSlowInEasing),
            repeatMode = RepeatMode.Reverse
        )
    )
}
🦜 2
👌 1
🙌 1
😍 2
c

Colton Idle

05/16/2022, 3:27 AM
Was this used in a video or docs somewhere?
b

Ben Trengrove [G]

05/16/2022, 3:29 AM

https://youtu.be/EOQB8PTLkpY?t=439

It's also in the new performance docs but the docs call it out as not being real
c

Colton Idle

05/16/2022, 3:53 AM
aha. sstill in my queue!
82 Views