LitDev.LDColours.GetRed C# (CSharp) Method

GetRed() public static method

Get the Red component of a colour.
public static GetRed ( Primitive colour ) : Primitive
colour Primitive The colour to get the component from.
return Primitive
        public static Primitive GetRed(Primitive colour)
        {
            try
            {
                return ((Media.Color)Media.ColorConverter.ConvertFromString(colour)).R;
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                return 0;
            }
        }