title: Can't turn JSON hex color into Java string or java.awt.Color
body: <p>I have a class <code>Foo</code>:</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class Foo {
    private String color = "cccccc";
  
    public void setColor(String color) {
      this.color = color;
    }
  
    @FlexField(fieldType = FlexField.FlexFieldType.ReadWrite)
    public Color getColor() {
      return ColorUtil.getColor(color);
    }
  
    public void setColor(Color color) {
      this.color = ColorUtil.getHexString(color);
    }
  }
  </code></pre>
  
  <p>a jackson color mixin:</p>
  
  <pre><code>abstract class ColorMixIn extends java.awt.Color{
      ColorMixIn(@JsonProperty("red") int red, @JsonProperty("green") int green, @JsonProperty("blue") int blue) {
          super(red, green, blue);
      }
  
      @Override @JsonProperty("red") public abstract int getRed();
      @Override @JsonProperty("green") public abstract int getGreen();
      @Override @JsonProperty("blue") public abstract int getBlue();
  
  }
  </code></pre>
  
  <p>a jackson color module:</p>
  
  <pre><code>public class ColorModule extends SimpleModule {
      @Override
      public void setupModule(SetupContext context) {
          context.setMixInAnnotations(java.awt.Color.class, ColorMixIn.class);
          //other setup if needed
      }
  }
  </code></pre>
  
  <p>and they get registered something like:</p>
  
  <pre><code>val mapper: ObjectMapper = new ObjectMapper
  mapper.registerModule(new ColorModule())
  </code></pre>
  
  <p>when I return a <code>Foo</code> it gets serialized as intended:</p>
  
  <pre><code>"foo": {
    "color": {
      "red": 204,
      "green": 204,
      "blue": 204
    }
  }
  </code></pre>
  
  <p>however when I want to create a foo from JSON it only ever creates:</p>
  
  <pre><code>"foo": {
    "color": "cccccc"
  }
  </code></pre>
  
  <p>I have tried JSON that looks like:</p>
  
  <pre><code>"foo": {
    "color": {
      "red": 224,
      "green": 224,
      "blue": 224
    }
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>"foo": {
    "color": "dddddd"
  }
  </code></pre>
  
  <p>to no avail.</p>
  
  <p>I thought creating a new constructor in the <code>ColorMixin</code> class that looks like:</p>
  
  <pre><code>ColorMixIn(@JsonProperty("color") String hex) {
    super(java.awt.Color.decode(hex).getRed(), java.awt.Color.decode(hex).getGreen(), java.awt.Color.decode(hex).getBlue()
  }
  </code></pre>
  
  <p>might help but no joy.</p>
  
  <p>I am sure I am missing something obvious, any ideas?</p>