I was looking to add animations to the color chang...
# compose
u
I was looking to add animations to the color changes in the
OutlinedTextField
by just basically copy pasting the source and
animateColorAsState
everything I see, but one thing made me think, if this is a good idea Why does the
TextFieldColors
return
State<Color>
?
Copy code
val textColor = textStyle.color.takeOrElse {
   colors.textColor(enabled).value
}
Copy code
@Stable
interface TextFieldColors {
    @Composable
    fun textColor(enabled: Boolean): State<Color>
why not simply
Color
?
z
Probably so color changes can be consumed without recomposing
👆🏻 1
👆 1
u
So.. is it a bad idea to add the animateColorAsState? I'm confused
s
So.. is it a bad idea to add the animateColorAsState
animateColorAsState
also returns
State<Color>
? What do you think is a bad idea here?