Create a Color using the Hex Values.

By [)ia6l0 iii

Use the FromArgb method of the Color Class and create the Color from the hex values.

Sample code:

private  Color ColorFromHexValue(string hexColor)
{
            Color c =  Color.FromArgb(
                        Convert.ToByte(hexColor.Substring(1, 2), 16),
                        Convert.ToByte(hexColor.Substring(3, 2), 16),
                        Convert.ToByte(hexColor.Substring(5, 2), 16),
                        Convert.ToByte(hexColor.Substring(7, 2), 16)
                    );
         return c;
}


Create a Color using the Hex Values.  (496 Views)