title: How can I draw a shadow for a path in canvas in jetpack compose
body: <p>I am drawing a custom shape for a topbar in jetpack compose.  I want to draw a shadow for the path.</p>
  <pre><code> val topBarShapePath = Path().apply {
          moveTo(dpToPixels(leftPadding), 0f)
          lineTo(dpToPixels(leftPadding), dpToPixels(dpValue = 110.dp))
          arcTo(
                  Rect(
                          dpToPixels(leftPadding),
                          dpToPixels(dpValue = 110.dp),
                          dpToPixels(dpValue = 32.dp),
                          dpToPixels(dpValue = 135.dp)
                  ), -180f, -90f, true)
          lineTo(
                  dpToPixels(dpValue = triangleStartX),
                  dpToPixels(dpValue = rectHeight))
          lineTo(
                  dpToPixels(dpValue = screenWidth),
                  dpToPixels(dpValue = triangleEndY)
          )
          lineTo(dpToPixels(dpValue = screenWidth), 0f)
          lineTo(dpToPixels(dpValue = leftPadding), 0f)
      }
      
      Column(
              modifier = Modifier
                      .fillMaxWidth()
                      .height(400.dp)
                      .drawBehind {
                          val finalWidth = 40.dp.toPx()
                          drawPath(
                                  topBarShapePath,
                                  color = topbarcolor)
                          drawOutline(
                              outline = Outline.Generic(
                                  topBarShapePath),
                              brush = Brush.horizontalGradient(),
                              style = Stroke(
                                  width = 1.dp.toPx(),
                              )
                          )
                      }
      )
  </code></pre>
  <p>This is the code I am using to draw the shape, the &quot;drawOutline&quot; was to try and draw a shadow for the path, but I can't figure out how to blur the line.</p>
  <p>Any help appreciated.</p>
  <p>Here is a screenshot of the result I am looking for:
  <a href="https://i.stack.imgur.com/4vSDD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4vSDD.png" alt="Image of result" /></a></p>