Skip to content

Instantly share code, notes, and snippets.

@aqua30
Created June 14, 2022 09:12
Show Gist options
  • Save aqua30/0da2b709c5a6a254efbdc1896f6d382a to your computer and use it in GitHub Desktop.
Save aqua30/0da2b709c5a6a254efbdc1896f6d382a to your computer and use it in GitHub Desktop.
/** filling the area under the path */
val fillPath = android.graphics.Path(stroke.asAndroidPath())
.asComposePath()
.apply {
lineTo(xAxisSpace * xValues.last(), size.height - yAxisSpace)
lineTo(xAxisSpace, size.height - yAxisSpace)
close()
}
drawPath(
fillPath,
brush = Brush.verticalGradient(
listOf(
Color.Cyan,
Color.Transparent,
),
endY = size.height - yAxisSpace
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment