Last active
May 31, 2022 09:12
-
-
Save cp-hardik-p/3e72075b6893af2fc096ba7883bc2ae1 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
@Composable | |
fun SadEmoji() { | |
val size = 100 | |
Canvas( | |
modifier = Modifier | |
.padding(top = 40.dp) | |
.size(size.dp) | |
) { | |
drawArc( | |
color = Color(0xFFFFd301), | |
startAngle = 0f, | |
sweepAngle = 360f, | |
useCenter = true | |
) | |
drawOval( | |
color = EmojiEyeColor, | |
topLeft = Offset(x = 25.dp.toPx(), y = 30.dp.toPx()), | |
size = Size(20f, 35f) | |
) | |
drawOval( | |
color = EmojiEyeColor, | |
topLeft = Offset(x = 65.dp.toPx(), y = 30.dp.toPx()), | |
size = Size(20f, 35f) | |
) | |
val mouthPath = Path().let { | |
it.moveTo(size * 0.30.dp.toPx(), size * 0.70.dp.toPx()) | |
it.quadraticBezierTo( | |
size * 0.45.dp.toPx(), size * 0.45.dp.toPx(), | |
size * 0.65.dp.toPx(), size * 0.65.dp.toPx() | |
) | |
it.quadraticBezierTo( | |
size * 0.45.dp.toPx(), size * 0.35.dp.toPx(), | |
size * 0.30.dp.toPx(), size * 0.70.dp.toPx() | |
) | |
it.close() | |
it | |
} | |
drawPath(path = mouthPath, color = TongueColor) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment