Skip to content

Instantly share code, notes, and snippets.

@Minikloon
Created July 13, 2018 18:28
Show Gist options
  • Save Minikloon/841eb7a02d2f3b9c87538c4a4f1173ae to your computer and use it in GitHub Desktop.
Save Minikloon/841eb7a02d2f3b9c87538c4a4f1173ae to your computer and use it in GitHub Desktop.
Color distribution formatting
fun main(args: Array<String>) {
val colors = listOf(
"#ff0000",
"#ffff00",
"#0000ff",
"#ff8000",
"#00ff00"
)
val sb = StringBuilder()
for(i in 1..20) {
val color = colors[(i - 1) % colors.size]
sb.append("[COLOR=$color]$i[/COLOR]-")
}
println(sb.toString())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment