How can we make some part of a composable transpar...
# compose
n
How can we make some part of a composable transparent like that?
1
Figured out:
Copy code
data class ClippedRectangleShape(private val widthFraction: Float) : Shape {
    override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density) =
        Outline.Rectangle(
            Rect(offset = Offset.Zero, size = size.copy(width = size.width * widthFraction))
        )
}
Use with
clip
modifier