Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
693 B
1
Indexable
Never
@Composable
fun BlurredShape(
    shape: Shape,
    blurRadius: Dp = 10.dp,
    color: Color = Color.Gray,
    content: @Composable () -> Unit
) {
    Box(
        modifier = Modifier
            .background(Brush.verticalGradient(listOf(Color.Transparent, color)))
            .graphicsLayer(
                clip = true,
                shape = shape,
                shadowElevation = blurRadius.value,
                shapeAppearance = shape
            )
    ) {
        content()
    }
}

@Composable
fun SharpEdgesRemoved() {
    BlurredShape(
        shape = RoundedCornerShape(16.dp),
        blurRadius = 10.dp,
        color = Color.Gray
    ) {
        // Your content here
    }
}