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
@Composable | |
fun foo() { | |
Canvas(Modifier | |
.fillMaxSize() | |
.wrapContentSize(Alignment.Center) | |
.preferredSize(120.dp, 120.dp) | |
// Provide a slight opacity to for compositing into an | |
// offscreen buffer to ensure blend modes are applied to empty pixel information | |
// By default any alpha != 1.0f will use a compositing layer by default | |
.drawLayer(alpha = 0.99f) |
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
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 | |
) |