protected void setCurrentStyle(String code) {
        String oldStyle = currentStyle;
        currentStyle = "";
        String newStyle = "";
        if (code.length() == 2) {
            if (code.contains("0")) {
                newStyle = defaultColor;
            } else if (code.contains("-")) {
                if (!(code.equals("--"))) {
                    if (code.charAt(0) == '-')
                        newStyle = "" + oldStyle.charAt(0) + code.charAt(1);
                    else
                        newStyle = "" + code.charAt(0) + oldStyle.charAt(1);
                }
            } else
                newStyle = code;

            if (containsColorCode(newStyle.charAt(0)))
                currentStyle += "" + newStyle.charAt(0);
            else
                currentStyle += "" + oldStyle.charAt(0);

            if (containsColorCode(newStyle.charAt(1)))
                currentStyle += "" + newStyle.charAt(1);
            else
                currentStyle += "" + oldStyle.charAt(1);
        } else
            currentStyle = oldStyle;
    }