Created
October 31, 2020 08:24
-
-
Save Skrilltrax/fb8c2cdb5cf540367e5922beaa0860e7 to your computer and use it in GitHub Desktop.
A modifier that add colorful border around your composables
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
import androidx.compose.foundation.border | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.composed | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.unit.Dp | |
import androidx.compose.ui.unit.dp | |
fun Modifier.colorfulBorders(width: Dp = 1.dp) = composed { | |
val red = (0..255).random() | |
val green = (0..255).random() | |
val blue = (0..255).random() | |
val color = Color(red, green, blue) | |
this.border(width, color) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment