Welcome to the rainbow text thread. This is a very simple program that automatically puts a rainbow on your text, i dedicated this program for the shoutbox but its very limited :/
You can also use this for theads like i have done :), Anyway here is the source code
Code:
import java.util.Scanner;
/**
* A very simple class dedicated to the rune-server shoutbox
* Keep in mind the shoutbox limits you
* @author zack/Optimum
*
*/
public class RainbowText {
/**
* This will keep a track of the next colour to add
*/
private static int colorIndex = 0;
/**
* A list of the all the possible colours
*/
private final static String[] COLOURS = {
"#FF2B21","#FF7C21","#FFDD56",
"#B4FF00","#00FF48","#00C2EF", "#0050EF",
"#6F09EF", "#E909FF"
};
/**
* This will find the next colour to add to
* the character
* @return
* - the colour string to add
*/
private static String applyColour(){
colorIndex++;
if(colorIndex >= COLOURS.length)
colorIndex = 0;
return COLOURS[colorIndex];
}
/**
* This will check the console for inputs and
* add the next colour in line to the character
* @param args
*/
@SuppressWarnings("resource")
public static void main(String[] args){
Scanner s = new Scanner(System.in);
while(s.hasNext()){
String letter = s.next();
System.out.print(" ");
for (int i = 0; i < letter.length(); i++)
System.out.print("[color=" + applyColour() + "]" + letter.substring(i, i + 1) + "[/color]");
}
}
}
or use monochromatic: Testing my monochromatic colour scheme. This shall be sick
Just by replacing this:
Code:
private final static String[] COLOURS = {
"#ffffff","#ffe5e5","#ffcccc",
"#ffb2b2","#ff9999","#ff7f7f",
"#ff6666", "#ff4c4c", "#ff3232",
"#ff1919", "#ff4c4c", "#ff6666",
"#ff7f7f", "#ff9999", "#ffb2b2",
"#ffcccc", "#ffe5e5",
};