if (tempChild.getFill(i) == -16777216) {} // throws an error, Adobe Illustrator provides no fill() element in the tree for any artwork containing black #000000 / -16777216, and because of this calling the getFill() method fails... SAD TROMBONE
// work around
static final color getPShapeFillColor(final PShape sh) {
try {
final java.lang.reflect.Field f =
PShape.class.getDeclaredField("fillColor");
f.setAccessible(true);
return f.getInt(sh);
}
catch (ReflectiveOperationException cause) {
throw new RuntimeException(cause);
}
}
Comments