Convert html string or color name to a Color object

By [)ia6l0 iii

Use the ColorTransalator to convert a html string or the color name to a valid Color object.

Like,

Color c = System.Drawing.ColorTranslator.FromHtml("#0485C0");
Color c = System.Drawing.ColorTranslator.FromHtml("Blue");

Related FAQs

C# 4.0 provides us a new type of generics - Tuples
You can truncate the file paths using the Shell LightWeight library.
The IndexOf method in C# is case -sensitive. However, you can use the CompareInto class to make it insensitive to case.
Extension method to get the start of a day
Extension method to get the elasped time
Extension method to get the end of a day
Convert html string or color name to a Color object  (939 Views)