title: Creating SolidColorBrush from hex color value
body: <p>I want to create SolidColorBrush from Hex value such as #ffaacc. How can I do this?</p>
  
  <p>On MSDN, I got :</p>
  
  <pre><code>SolidColorBrush mySolidColorBrush = new SolidColorBrush();
  mySolidColorBrush.Color = Color.FromArgb(255, 0, 0, 255);
  </code></pre>
  
  <p>So I wrote (considering my method receives color as <code>#ffaacc</code>):</p>
  
  <pre><code>Color.FromRgb(
    Convert.ToInt32(color.Substring(1, 2), 16), 
    Convert.ToInt32(color.Substring(3, 2), 16), 
    Convert.ToInt32(color.Substring(5, 2), 16));
  </code></pre>
  
  <p>But this gave error as </p>
  
  <p><code>The best overloaded method match for 'System.Windows.Media.Color.FromRgb(byte, byte, byte)' has some invalid arguments</code></p>
  
  <p>Also 3 errors as: <code>Cannot convert int to byte.</code></p>
  
  <p>But then how MSDN example works?</p>