Pulse
An infinitely repeating tween reverses to pulse the alpha.
val transition = rememberInfiniteTransition(label = "pulse")
val alpha by transition.animateFloat(
initialValue = 1f,
targetValue = 0.2f,
animationSpec = infiniteRepeatable(
animation = tween(800),
repeatMode = RepeatMode.Reverse
),
label = "alpha"
)
Box(
Modifier.size(96.dp).alpha(alpha)
.clip(RoundedCornerShape(16.dp))
.background(Color(0xFF6750A4))
)