Skip to content

Instantly share code, notes, and snippets.

@0xZhangKe
Created July 16, 2023 14:41
Show Gist options
  • Save 0xZhangKe/f2d4a1771b33f4a046ca9a861ecfc04e to your computer and use it in GitHub Desktop.
Save 0xZhangKe/f2d4a1771b33f4a046ca9a861ecfc04e to your computer and use it in GitHub Desktop.
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
BezierCurve(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, end = 30.dp)
.height(100.dp),
points = listOf(10F, 30F, 80F, 10F, 20F, 90F, 10F, 60F, 20F),
minPoint = 0F,
maxPoint = 100F,
style = BezierCurveStyle.CurveStroke(
brush = Brush.horizontalGradient(listOf(Color(0x2200FF00), Color(0xFF00FF00))),
stroke = Stroke(width = 3.dp.toPx())
),
)
BezierCurve(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, top = 30.dp, end = 30.dp)
.height(100.dp),
points = listOf(20F, 80F, 30F, 70F, 20F, 90F, 10F, 60F, 20F),
minPoint = 0F,
maxPoint = 100F,
style = BezierCurveStyle.Fill(
brush = Brush.verticalGradient(listOf(Color(0x3300FF00), Color(0xFF00FF00))),
),
)
BezierCurve(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, top = 30.dp, end = 30.dp)
.height(100.dp),
points = listOf(20F, 80F, 30F, 70F, 20F, 90F, 10F, 60F, 20F),
minPoint = 0F,
maxPoint = 100F,
style = BezierCurveStyle.StrokeAndFill(
strokeBrush = Brush.horizontalGradient(listOf(Color.Red, Color.Blue)),
fillBrush = Brush.verticalGradient(listOf(Color(0xFF00FF00), Color(0x3300FF00))),
stroke = Stroke(width = 1.dp.toPx())
),
)
BezierCurve(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, top = 30.dp, end = 30.dp)
.height(100.dp),
points = listOf(20F, 80F, 30F, 70F, 20F, 90F, 10F, 60F, 20F),
minPoint = 0F,
maxPoint = 100F,
style = BezierCurveStyle.Fill(brush = SolidColor(Color.Blue)),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment