Skip to content

Instantly share code, notes, and snippets.

@cp-hardik-p
Last active May 31, 2022 09:12
Show Gist options
  • Save cp-hardik-p/3e72075b6893af2fc096ba7883bc2ae1 to your computer and use it in GitHub Desktop.
Save cp-hardik-p/3e72075b6893af2fc096ba7883bc2ae1 to your computer and use it in GitHub Desktop.
@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