[TUTORIAL] Colors!

Discussion in 'Resources' started by Deleted user, Nov 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Deleted user

    Enjoy dem custom colors!


    For coding:
    Code:
    ChatColor.COLORSTUFF
    For reading input:
    Code:
    ChatColor.translateAlternateColorCodes('&', STRINGYTHINGY);
    // Replaces all color codes with the & sign from the string
    Errors you say?
    Code:
    String s = ChatColor.RED;
    s += "Hi";
    // Fix It!
    String s = ChatColor.RED + "";
    s += "Hi";
    No Italics/Bold:
    Code:
    String s = ChatColor.ITALIC + "" + ChatColor.RED + "Hi";
    // Fix it!
    String s = ChatColor.RED + "" + ChatColor.ITALIC + "Hi";
    More Errors!
    Code:
    String s = ChatColor.RED + ChatColor.ITALIC + "Hi";
    // Fix it!
    String s = ChatColor.RED + "" + ChatColor.ITALIC + "Hi";

    Enjoy,
    JHG0
     
  2. Offline

    macguy8

    For all the times you do Color + "" + Color:

    You should use Color.toString() + Color to help the JVM and (by a very tiny margin) increase performance.
     
    Maulss and Ultimate_n00b like this.
Thread Status:
Not open for further replies.

Share This Page