Created
May 12, 2021 11:28
-
-
Save Spikeysanju/bb9ab8f003efcf1fb3343d7fcbea92c3 to your computer and use it in GitHub Desktop.
UI Tips β
: You don't need multiple colours to make beautiful gradient!. Pick any vibrant colour & At One side reduce pass through to 0.4 - 0.7f. Now you will get Eye-Pleasing Gradients π
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 GradientLogoWithText(source: String, color: Color) { | |
val gradientBrush = Brush.linearGradient(listOf(color, color.copy(.7f))) | |
Box( | |
modifier = Modifier | |
.size(80.dp) | |
.padding(start = 12.dp, top = 12.dp, end = 12.dp, bottom = 12.dp) | |
.clip(CircleShape) | |
.background(brush = gradientBrush) | |
) { | |
Text( | |
text = source.first().toString(), | |
color = white, | |
style = typography.subtitle1, | |
textAlign = TextAlign.Center, | |
modifier = Modifier.align(Alignment.Center) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment