Skip to content

Instantly share code, notes, and snippets.

@Skrilltrax
Created October 31, 2020 08:24
Show Gist options
  • Select an option

  • Save Skrilltrax/fb8c2cdb5cf540367e5922beaa0860e7 to your computer and use it in GitHub Desktop.

Select an option

Save Skrilltrax/fb8c2cdb5cf540367e5922beaa0860e7 to your computer and use it in GitHub Desktop.

Revisions

  1. Skrilltrax created this gist Oct 31, 2020.
    15 changes: 15 additions & 0 deletions ColorfulBorders.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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)
    }