Tom Truyen
04/12/2024, 12:35 PMdrawArc
in Canvas.
On the Transparent end of my "arc" it seems to reset the color of my cap to the initial red color, though I just want the gradient to continue over it
CODE IN THREADTom Truyen
04/12/2024, 12:35 PMCanvas(
modifier = Modifier
.rotate(rotateTransition)
.padding(thickness / 2)
.size(48.dp),
onDraw = {
val gradientBrush = Brush.sweepGradient(
colors = listOf(Color.Transparent, color),
center = Offset(
x = size.width / 2,
y = size.height / 2
),
)
drawArc(
brush = gradientBrush,
startAngle = 0f,
sweepAngle = 270f,
useCenter = false,
style = Stroke(
width = thickness.toPx(),
cap = StrokeCap.Round,
)
)
}
)
Stylianos Gakis
04/12/2024, 12:53 PMstartAngle = 2.dp.toPx(),
might help you for now until someone smarter comes in with a real solution đ
Tom Truyen
04/12/2024, 12:59 PMTom Truyen
04/12/2024, 12:59 PMStylianos Gakis
04/12/2024, 1:13 PM