Created
July 9, 2021 16:33
-
-
Save mahendranv/794e9584cc003c83f1790c8badac262f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val HeartShape = GenericShape { size, _ -> | |
val h = size.height | |
val w = size.width | |
lineTo(0.5f*w, 0.25f*h) | |
cubicTo(0.5f*w, 0.225f*h, 0.458333333333333f*w, 0.125f*h, 0.291666666666667f*w, 0.125f*h) | |
cubicTo(0.0416666666666667f*w, 0.125f*h, 0.0416666666666667f*w, 0.4f*h, 0.0416666666666667f*w, 0.4f*h) | |
cubicTo(0.0416666666666667f*w, 0.583333333333333f*h, 0.208333333333333f*w, 0.766666666666667f*h, 0.5f*w, 0.916666666666667f*h) | |
cubicTo(0.791666666666667f*w, 0.766666666666667f*h, 0.958333333333333f*w, 0.583333333333333f*h, 0.958333333333333f*w, 0.4f*h) | |
cubicTo(0.958333333333333f*w, 0.4f*h, 0.958333333333333f*w, 0.125f*h, 0.708333333333333f*w, 0.125f*h) | |
cubicTo(0.583333333333333f*w, 0.125f*h, 0.5f*w, 0.225f*h, 0.5f*w, 0.25f*h) | |
close() | |
} | |
@Composable | |
fun Heart(modifier: Modifier = Modifier) { | |
Surface( | |
shape = HeartShape, | |
color = color_orange, | |
modifier = Modifier | |
.height(100.dp) | |
.width(100.dp) | |
) { | |
// An image view? | |
} | |
} | |
Author
mahendranv
commented
Jul 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment