GEORGE TRIFONOV Home Developer Corner Contact Resume 
Theme
Login
 
 
Tip Of the Day - Converting string to System.Color

Hi I'd like to start publishing "c# tip's of the day" posts which will contain small trivial(or may be not) C# snippets which searched or looked today.
 
Today's tip will be  - how to parse Color from HEX string. Hex colors are commonly user in web css styles and System.Color didn't provide direct access to method allowing to parse color from string.
 
   1: string xCol = "#FF00DD";
   2: Color c = System.Drawing.ColorTranslator.FromHtml(xCol);
Share this post: email it! | bookmark it! | digg it! | kick it! | live it!
Posted: Thu, 25 Oct 2007 11:45:38 GMT By: Gtrifonov