示例#1
0
  protected void applyColor(
      @Nonnull final LayoutContext context,
      @Nonnull final JSONObject properties,
      @Nonnull final Quad quad) {
    final JSON property = context.resolveProperty(properties, "color");

    if (null != property) {
      if (property.isString()) {
        quad.color(Color.valueOf(context.interpolateString(property.stringValue())));
      } else {
        quad.color(property.intValue());
      }
    }
  }
示例#2
0
 /** {@inheritDoc} */
 @Nonnull
 @Override
 protected Future<Void> inflate(
     @Nonnull final LayoutContext context,
     @Nonnull final JSONObject properties,
     @Nonnull final DisplayObject displayObject) {
   return super.inflate(context, properties, displayObject)
       .proceed(
           theVoid -> applyColor(context, properties, (Quad) displayObject), context.dispatcher());
 }