package in.twizmwaz.cardinal.util;

import org.bukkit.ChatColor;
import org.bukkit.Color;

public class MiscUtils {

    public static Color convertChatColorToColor(ChatColor chatColor) {
        if (chatColor.isColor()) {
            switch (chatColor) {
                case AQUA:
                    return Color.fromRGB(0, 255, 255);
                case BLACK:
                    return Color.fromRGB(0, 0, 0);
                case BLUE:
                    return Color.fromRGB(128, 128, 255);
                case DARK_AQUA:
                    return Color.fromRGB(0, 128, 128);
                case DARK_BLUE:
                    return Color.fromRGB(0, 0, 255);
                case DARK_GRAY:
                    return Color.fromRGB(64, 64, 64);
                case DARK_GREEN:
                    return Color.fromRGB(0, 128, 0);
                case DARK_PURPLE:
                    return Color.fromRGB(128, 0, 128);
                case DARK_RED:
                    return Color.fromRGB(192, 0, 0);
                case GOLD:
                    return Color.fromRGB(255, 128, 0);
                case GRAY:
                    return Color.fromRGB(196, 0, 0);
                case GREEN:
                    return Color.fromRGB(255, 196, 0);
                case LIGHT_PURPLE:
                    return Color.fromRGB(255, 0, 255);
                case RED:
                    return Color.fromRGB(255, 0, 0);
                case WHITE:
                    return Color.fromRGB(255, 255, 255);
                case YELLOW:
                    return Color.fromRGB(255, 255, 0);
                default:
                    return Color.fromRGB(128, 128, 128);
            }
        } else {
            return Color.fromBGR(128, 128, 128);
        }
    }
}

@@ -307,33 +307,32 @@
 urn 
-Color.fromRGB(0, 255, 255
+convertHexToRGB(%2255FFFF%22
 );%0A 
@@ -389,29 +389,32 @@
 urn 
-Color.fromRGB(0, 0, 0
+convertHexToRGB(%22000000%22
 );%0A 
@@ -470,35 +470,32 @@
 urn 
-Color.fromRGB(128, 128, 255
+convertHexToRGB(%225555FF%22
 );%0A 
@@ -556,33 +556,32 @@
 urn 
-Color.fromRGB(0, 128, 128
+convertHexToRGB(%2200AAAA%22
 );%0A 
@@ -642,31 +642,32 @@
 urn 
-Color.fromRGB(0, 0, 255
+convertHexToRGB(%220000AA%22
 );%0A 
@@ -728,32 +728,32 @@
 urn 
-Color.fromRGB(64, 64, 64
+convertHexToRGB(%22555555%22
 );%0A 
@@ -815,31 +815,32 @@
 urn 
-Color.fromRGB(0, 128, 0
+convertHexToRGB(%2200AA00%22
 );%0A 
@@ -903,33 +903,32 @@
 urn 
-Color.fromRGB(128, 0, 128
+convertHexToRGB(%22AA00AA%22
 );%0A 
@@ -988,31 +988,32 @@
 urn 
-Color.fromRGB(192, 0, 0
+convertHexToRGB(%22AA0000%22
 );%0A 
@@ -1069,33 +1069,32 @@
 urn 
-Color.fromRGB(255, 128, 0
+convertHexToRGB(%22FFAA00%22
 );%0A 
@@ -1150,31 +1150,32 @@
 urn 
-Color.fromRGB(196, 0, 0
+convertHexToRGB(%22AAAAAA%22
 );%0A 
@@ -1232,33 +1232,32 @@
 urn 
-Color.from
+convertHexTo
 RGB(
-255, 196, 0
+%2255FF55%22
 );%0A 
@@ -1321,33 +1321,32 @@
 urn 
-Color.fromRGB(255, 0, 255
+convertHexToRGB(%22FF55FF%22
 );%0A 
@@ -1401,31 +1401,32 @@
 urn 
-Color.fromRGB(255, 0, 0
+convertHexToRGB(%22FF5555%22
 );%0A 
@@ -1483,35 +1483,32 @@
 urn 
-Color.fromRGB(255, 255, 255
+convertHexToRGB(%22FFFFFF%22
 );%0A 
@@ -1566,33 +1566,32 @@
 urn 
-Color.fromRGB(255, 255, 0
+convertHexToRGB(%22FFFF55%22
 );%0A 
@@ -1645,35 +1645,32 @@
 urn 
-Color.fromRGB(128, 128, 128
+convertHexToRGB(%22AAAAAA%22
 );%0A 
@@ -1722,47 +1722,269 @@
 urn 
-Color.fromBGR(128, 128, 128);%0A        %7D
+convertHexToRGB(%22AAAAAA%22);%0A        %7D%0A    %7D%0A%0A    public static Color convertHexToRGB(String color) %7B%0A        return Color.fromRGB(Integer.valueOf(color.substring(0, 2), 16), Integer.valueOf(color.substring(2, 4), 16), Integer.valueOf(color.substring(4, 6), 16));
 %0A   

Fix colors in the team picker (make them hex-based)