Created
June 14, 2022 09:12
-
-
Save aqua30/0da2b709c5a6a254efbdc1896f6d382a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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