Vsevolod Ganin
11/07/2020, 1:00 AMRadialGradient
is not working properly as of alpha06. I want to draw a simple circle that have white color from center to 0.5 * radius
and then have a uniform blend from white to black from 0.5 * radius
to radius
. What I did is
Canvas(modifier = Modifier.fillMaxSize()) {
drawCircle(
brush = RadialGradient(
0.0f to Color.White,
0.5f to Color.White,
1.0f to Color.Black,
centerX = center.x,
centerY = center.y,
radius = size.width
)
)
}
This code displays the whole circle in white.Nader Jawad
11/07/2020, 5:43 AMsize.width
instead of size.width / 2
Canvas(modifier = Modifier.fillMaxSize()) {
drawCircle(
brush = RadialGradient(
0.0f to Color.White,
0.5f to Color.White,
1.0f to Color.Black,
centerX = center.x,
centerY = center.y,
radius = size.width / 2 // changed from size.width
)
)
}
Vsevolod Ganin
11/07/2020, 10:22 AM