title: How to define a Color from a string constant
body: <p>I have a static class with statically defined HEX values of colors:</p>
  
  <pre><code>namespace Namespace1
  {
      public static class MyColors
      {
          public const string COLOR_1 = "#AABBCC";
          // ...
      }
  }
  </code></pre>
  
  <p>I want to have all these colors defined in a resource dictionary so that they can be used in XAML:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
      x:Class="Namespace2.Style.Colors"
      xmlns:n1="clr-namespace:Namespace1;assembly=Assembly1"&gt;
      &lt;Color x:Key="Color1" x:FactoryMethod="FromHex"&gt;
          &lt;x:Arguments&gt;
              &lt;x:String&gt;{x:Static n1:MyColors.COLOR_1}&lt;/x:String&gt;
          &lt;/x:Arguments&gt;
      &lt;/Color&gt;
      &lt;!-- ... --&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>But this doesn't seem to work. There is no compile error, but the color itself is empty (transparent).</p>
  
  <p>If I replace the <code>{x:Static n1:MyColors.COLOR_1}</code> part with the actual <code>#AABBCC</code> value, then it works.</p>
  
  <p>I have also tested the <code>{x:Static n1:MyColors.COLOR_1}</code> part (with Label and Text property) and it works.</p>
  
  <p>So what is the problem here? This seems like an internal Xamarin.Forms bug.</p>