Skip to content

Instantly share code, notes, and snippets.

@worstkiller
Created August 14, 2021 06:27
Show Gist options
  • Save worstkiller/cbea9be6ddaece65358533d6f1cf2f56 to your computer and use it in GitHub Desktop.
Save worstkiller/cbea9be6ddaece65358533d6f1cf2f56 to your computer and use it in GitHub Desktop.
@Composable
fun messengerIcon() {
val colors = listOf(Color(0xFF02b8f9), Color(0xFF0277fe))
Canvas(
modifier = Modifier
.size(100.dp)
.padding(16.dp)
) {
val trianglePath = Path().let {
it.moveTo(this.size.width * .20f, this.size.height * .77f)
it.lineTo(this.size.width * .20f, this.size.height * 0.95f)
it.lineTo(this.size.width * .37f, this.size.height * 0.86f)
it.close()
it
}
val electricPath = Path().let {
it.moveTo(this.size.width * .20f, this.size.height * 0.60f)
it.lineTo(this.size.width * .45f, this.size.height * 0.35f)
it.lineTo(this.size.width * 0.56f, this.size.height * 0.46f)
it.lineTo(this.size.width * 0.78f, this.size.height * 0.35f)
it.lineTo(this.size.width * 0.54f, this.size.height * 0.60f)
it.lineTo(this.size.width * 0.43f, this.size.height * 0.45f)
it.close()
it
}
drawOval(
Brush.verticalGradient(colors = colors),
size = Size(this.size.width, this.size.height * 0.95f)
)
drawPath(
path = trianglePath,
Brush.verticalGradient(colors = colors),
style = Stroke(width = 15f, cap = StrokeCap.Round)
)
drawPath(path = electricPath, color = Color.White)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment