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

alorma

02/26/2021, 9:59 AM
Another question... I'm trying to do a colored card, using:
Copy code
backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.12f).compositeOverSurface()
That is supposed to do a dim version of
primary
color... but it shows plain
primary
v

Vivek Sharma

02/26/2021, 12:23 PM
what is
compositeOverSurface
for ? can you try removing it and try
a

alorma

02/26/2021, 12:30 PM
If I remove it then the card is translucent and shadow is drawn incorrectly
compositeOverSurface
puts one color "over" surface, so if the color has alpha, it will draw a solid version, but provided by surface...
Good fdr dark mode
v

Vivek Sharma

02/26/2021, 12:58 PM
oh, so then do one thing
Copy code
MaterialTheme.colors.primary.compositeOverSurface().copy(alpha = 0.12f)
check if this works for you