Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A modifier that add colorful border around your composables
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
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