fix: use theme background when ShowMore gradient color is transparent

Several callers pass Color.Transparent as the rich-text backgroundColor.
getGradient was copying that color and forcing alpha=1, which produced
opaque black (Color(0,0,0,1)) as the gradient end — so on a light theme
the fade behind the "Show more" button looked pitch black.

Fall back to MaterialTheme.colorScheme.background when the supplied
background has alpha 0, so the gradient fades from transparent into the
actual surface color.
This commit is contained in:
Claude
2026-05-16 19:46:39 +00:00
parent f1d02f3c60
commit e6a5ba9e15
@@ -1484,14 +1484,22 @@ fun RenderRepost(
}
}
fun getGradient(backgroundColor: MutableState<Color>): Brush =
Brush.verticalGradient(
@Composable
fun getGradient(backgroundColor: MutableState<Color>): Brush {
val solid =
if (backgroundColor.value.alpha == 0f) {
MaterialTheme.colorScheme.background
} else {
backgroundColor.value.copy(alpha = 1f)
}
return Brush.verticalGradient(
colors =
listOf(
backgroundColor.value.copy(alpha = 0f),
backgroundColor.value.copy(alpha = 1f),
solid.copy(alpha = 0f),
solid,
),
)
}
@Composable
fun ReplyNoteComposition(