julioromano
03/25/2021, 1:18 PMCard
with a backgroundColor
that has an alpha value (i.e. not 00 and not FF) I’m seeing visual artefacts in the form of a border around the card.
See attached image (code in 🧵), is this working as intended or is this a bug?julioromano
03/25/2021, 1:18 PM@Composable
fun CardColorAlphaGlitch() {
Column(
modifier = Modifier
.background(Color(0xFFFFFFFF))
.padding(16.dp)
.width(200.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Card(backgroundColor = Color(0x80283593)) {
Text(
text = "This card has a background with alpha",
modifier = Modifier.padding(16.dp)
)
}
Card(backgroundColor = Color(0xFF283593)) {
Text(
text = "This card has a background without alpha",
modifier = Modifier.padding(16.dp)
)
}
}
}
Louis Pullen-Freilich [G]
03/25/2021, 1:21 PMCard
has by default, if you remove the elevation this won't happenTimo Drick
03/25/2021, 1:31 PMjulioromano
03/25/2021, 1:31 PMTimo Drick
03/25/2021, 2:22 PMGabriel Melo
03/25/2021, 2:25 PMAndrey Kulikov
03/25/2021, 3:30 PMbackgroundColor = Color(0xFF283593).compositeOver(Color.White)
alorma
03/25/2021, 3:31 PMbackgroundColor = Color(0xFF283593).compositeOver(MaterialTheme.colors.surface)
SO it composites over white or black, or whatever your current surface color is