Skip to content

Instantly share code, notes, and snippets.

@IslamBesto
Created March 14, 2024 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IslamBesto/c63e4f840e22ea8707e2ec07d3bdf505 to your computer and use it in GitHub Desktop.
Save IslamBesto/c63e4f840e22ea8707e2ec07d3bdf505 to your computer and use it in GitHub Desktop.
Colored rectangles
val screenHeight = size.height
val rectHeight = screenHeight / 10
for (i in 0 until 10) {
val color = if (i % 2 == 0) lightStadiumGreen else darkStadiumGreen
drawRect(
color = color,
topLeft = Offset(0f, i * rectHeight),
size = Size(size.width, rectHeight)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment