Silverlight Get Color from Hex

Posted by: Laurent Duveau, on 22 Apr 2009 | View original | Bookmarked: 0 time(s)

What if you want to get a Color from its hexa value (#FFBBCC88) ? Unfortunately Silverlight do not have the ColorTranslator class which allows you to do ColorTranslator.FromHtml("#FF1133") in ASP.NET. What we have is the Color.FromArgb() method which takes 4 parameters (alpha, red, blue and green channels as bytes). So here is a small method you could write: public static SolidColorBrush GetColorFromHexa(string hexaColor) { return new SolidColorBrush( Color.FromArgb( ...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: C# | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2365 | Hits: 160

Similar Posts

  • The ESRI Dev Summit 2010 hosted in Palms Springs CA is open for registration. more
  • Using T4 Templates for Simple DTOs more
  • Dynamic in C# 4.0: Creating Wrappers with DynamicObject more
  • Silverlight MVP more
  • Beaded jewelry more
  • Building a class browser with Microsoft Ajax 4.0 Preview 5 more
  • Mixing Silverlight and MS ASP.NET AJAX 3.5 in the same web application. more
  • In Response To DNR 476 more
  • Self-reference hierarchy with Telerik TreeView for Silverlight more
  • RadDrag&Drop with a Canvas twist more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD