I'm creating `Button()` and fill it with white col...
# compose
r
I'm creating
Button()
and fill it with white color, but it gets filled with theme's primary color and not the white color.
Copy code
Button(
        modifier = Modifier
            .size(80.dp)
            .clip(CircleShape)
            .background(Color.White)
//            .background(MaterialTheme.colors.surface) //It's also not working
            .border(5.dp, Color.White, CircleShape),
        onClick = {  })
    {

    }
r
There are 2 .background() functions, the last one overrides the previous one. What's the color of MaterialTheme.colors.surface in this case?
r
nope, second one is commented out, its just there to show that if i use second one and comment out first one, it's still not working
r
Ah yeah
I faced this in the past
Add this
Copy code
colors = ButtonDefaults.buttonColors(
    backgroundColor = Color.White
)
In the parameter of the button
Copy code
Button(
        modifier = Modifier
            .size(80.dp)
            .clip(CircleShape)
            .background(Color.White)
//            .background(MaterialTheme.colors.surface) //It's also not working
            .border(5.dp, Color.White, CircleShape),
        colors = ButtonDefaults.buttonColors(
            backgroundColor = Color.White
        ),
        onClick = {  })
    {

    }
r
Great. Thanks