title: getting a color by name in java
body: <p>I am working with an object model that contains a <code>Color</code> object.</p>
  
  <pre><code>import java.awt.Color;
  
  public class MyObject {
  
      ...
      private String color;
  
      public void setColor( Color c ) ...
      public Color getColor() ...
      ...
  
  }
  </code></pre>
  
  <p>In the response of a json query, I am left with a physical name of a color</p>
  
  <blockquote>
    <p>"color":"blue"</p>
  </blockquote>
  
  <p>I know that the <em>Color</em> object has statics i.e.</p>
  
  <pre><code>Color.blue;
  </code></pre>
  
  <p>Is there any way to decode actual color names into Color objects? Or would I need to manually map the strings to rgb values myself?</p>
  
  <p>I am looking for something that should be the output of this</p>
  
  <pre><code>Color c = new Color("blue");
  </code></pre>
  
  <p>which does not work</p>