fCraft.ChatColor.Parse C# (CSharp) Method

Parse() private method

private Parse ( [ color ) : string
color [
return string
        public static string Parse([NotNull] string color) {
            if (color == null) throw new ArgumentNullException("color");
            switch (color.Length) {
                case 2:
                    if (color[0] == '&') {
                        return Parse(color[1]);
                    }
                    break;

                case 1:
                    return Parse(color[0]);

                case 0:
                    return "";
            }
            color = color.ToLower();
            if (ColorNames.ContainsValue(color)) {
                return "&" + ColorNames.Keys[ColorNames.IndexOfValue(color)];
            } else {
                return null;
            }
        }

Same methods

ChatColor::Parse ( char code ) : string