MapSuiteGisEditor/GisEditorPluginCore/Shares/UIs/Controls/SolidColorPicker/ColorHelper.cs
/// <summary>
/// Convert a hexadecimal string to <see cref="Color"/>.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Convert a hexadecimal string to .
Convert a hexadecimal string to .
public static Color HexToColor(string value)
        {
            value = value.Trim('#');
            if (value.Length == 0)
                return UndefinedColor;
            if (value.Length <= 6)
                value = "FF" + value.PadLeft(6, '0');
            uint u;
            if (uint.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out u))
                return UIntToColor(u);
            return UndefinedColor;
        }
public static Color HexToColor ( string value ) { value = value . Trim ( ' ' ) ; if ( value . Length == 0 ) return UndefinedColor ; if ( value . Length <= 6 ) value = " " + value . PadLeft ( 6 , ' ' ) ; uint u ; if ( uint . TryParse ( value , NumberStyles . HexNumber , CultureInfo . InvariantCulture , out u ) ) return UIntToColor ( u ) ; return UndefinedColor ; }
Convert a hexadecimal string to .
Convert a hexadecimal string to .
None
value
string
None