Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 4
    Color.FromArgb requires a, r, g, and b parameters, not an integer. Commented Nov 30, 2012 at 22:41
  • 7
    This is also useful if you are using the Compact Framework in which ColorTranslator is not available Commented Apr 23, 2013 at 12:25
  • 2
    On Windows Phone at least, Color.FromArgb takes 4 byte arguments, not an int. Commented Oct 26, 2013 at 1:20
  • 7
    @user1763532 - After colorcode = colorcode.Replace("#", "") simply use int a = byte.parse(colorcode.Substring(0,2), NumberStyles.HexNumber); and so on for r, g, and b. Don't forget to replace the first parameter of Substring - the index - with 2 for r, 4 for g and 6 for b. Commented Dec 24, 2013 at 11:29
  • 4
    @HansKesting, FromArgb takes 1 parameter in System.Drawing.Color and 4 paramteres in System.Windows.Media.Color Commented Oct 8, 2015 at 22:16