Blog.Mobile.Helpers.Color.FromHex C# (CSharp) Method

FromHex() public static method

public static FromHex ( int hex ) : Color
hex int
return Color
        public static Color FromHex(int hex)
        {
            Func<int, int> at = offset => (hex >> offset) & 0xFF;
            return new Color
            {
                R = at(16) / 255.0,
                G = at(8) / 255.0,
                B = at(0) / 255.0
            };
        }