Assets/FlexibleColorPicker/Scripts/FlexibleColorPicker.cs
/// <summary>
/// tries to parse given string input as hexadecimal color e.g.
/// "#FF00FF" or "223344" returns default color if string failed to 
/// parse.
/// </summary>
tries to parse given string input as hexadecimal color e.g.
"#FF00FF" or "223344" returns default color if string failed to
parse.
tries to parse given string input as hexadecimal color e . g . " #FF00FF " or " 223344 " returns default color if string failed to parse .
public static Color ParseHex(string input, Color defaultColor) {
        string parseText = GetSanitizedHex(input, true);
        Color toReturn;
        if(ColorUtility.TryParseHtmlString(parseText, out toReturn))
            return toReturn;
        else
            return defaultColor;
    }
public static Color ParseHex ( string input , Color defaultColor ) { string parseText = GetSanitizedHex ( input , true ) ; Color toReturn ; if ( ColorUtility . TryParseHtmlString ( parseText , out toReturn ) ) return toReturn ; else return defaultColor ; }
tries to parse given string input as hexadecimal color e.g.
tries to parse given string input as hexadecimal color e . g .
input
string
defaultColor
Color