Created
July 13, 2018 18:28
-
-
Save Minikloon/841eb7a02d2f3b9c87538c4a4f1173ae to your computer and use it in GitHub Desktop.
Color distribution formatting
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
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