Last active
May 31, 2022 09:08
-
-
Save cp-hardik-p/36a904a04be60a4ceb212e72eb771e57 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 LongTongueEmoji() { | |
val size = 100 | |
Canvas( | |
modifier = Modifier | |
.padding(top = 16.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.20.dp.toPx(), size * 0.70.dp.toPx()) | |
it.quadraticBezierTo( | |
size * 0.50.dp.toPx(), size * 0.80.dp.toPx(), | |
size * 0.78.dp.toPx(), size * 0.70.dp.toPx() | |
) | |
it.quadraticBezierTo( | |
size * 0.50.dp.toPx(), size * 1.90.dp.toPx(), | |
size * 0.20.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