Hi all, I am trying to add a drop shadow to my ell...
# compose
g
Hi all, I am trying to add a drop shadow to my ellipses I've created using Compose Multiplatform. I've tried a few different ways of doing this and nothing seems to work. Here is my Ellipses composable, does anyone know how to add a drop shadow? Edit: I've also had Gemini 2.5 make the modifications to add drop shadow and it is not able to for compose multiplatform.
Copy code
@Composable
fun Ellipse(color: Color, modifier: Modifier) {
    Canvas(
        modifier = modifier
//            .shadow(
//                elevation = 8.dp,
//                spotColor = Color.Black.copy(alpha = 0.25f),
//                ambientColor = Color.Black.copy(alpha = 0.25f),
//                shape = androidx.compose.foundation.shape.RoundedCornerShape(100)
//            )
//            .offset(y = 4.dp)
    ) {
        val centerX = size.width / 2
        val centerY = size.height / 2
        val radiusX = size.width / 2
        val radiusY = size.height / 2

        drawOval(
            color = color,
            topLeft = Offset(centerX - radiusX, centerY - radiusY),
            size = Size(radiusX * 2, radiusY * 2),

        )
    }
}
s
I don’t think Shadow modifier works on multiplatform yet