Last active
August 29, 2015 14:02
-
-
Save hintss/c77d5833ce5e0b5c28dd to your computer and use it in GitHub Desktop.
bukkit rainbows
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
String input = "blah"; | |
StringBuilder output = new StringBuilder(); | |
ChatColor[] colors = new ChatColor[] {ChatColor.RED, ChatColor.GOLD, ChatColor.YELLOW, ChatColor.GREEN, ChatColor.AQUA, ChatColor.LIGHT_PURPLE, ChatColor.DARK_PURPLE}; | |
for (int i = 0; i < input.length(); i++) { | |
output.append(colors[i % colors.length]).append(input.substring(i, i + 1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment