Steffen Funke
11/10/2021, 4:21 PMSurface
to not set any contentColor
, e.g. make it behave like a Box
in this regard? I have custom colored content (Texts, Sliders, etc….), but as soon as I wrap them into a ModalBottomSheetLayout
- which is backed by a Surface
- everything gets tinted with the contentColor
. I surely miss something here. 🤔@Composable
fun Surface(
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
color: Color = MaterialTheme.colors.surface,
contentColor: Color = contentColorFor(color),
border: BorderStroke? = null,
elevation: Dp = 0.dp,
content: @Composable () -> Unit
) {
Surface(
modifier = modifier,
shape = shape,
color = color,
contentColor = contentColor,
border = border,
elevation = elevation,
content = content,
clickAndSemanticsModifier = Modifier
.semantics(mergeDescendants = false) {}
.pointerInput(Unit) { }
)
}
contentColor
to null to have the widgets shown their color. But I guess that is not how it is supposed to work.Luke
11/10/2021, 4:27 PMcontentColor = Color.Transparent
would help?Color.Unspecified
Steffen Funke
11/10/2021, 4:32 PMcolor
(which actually is its backgroundColor
) fixes the alpha of the foreground now. Interesting. Thanks for pointing me in the direction @Luke !