}
}
List<String> blackList = Collections.emptyList();
writeMotionCurves(layer, xb, layerAttrList, null, blackList);
RGBPalette palette = layer.getPalette();
writeMotionCurves(palette, xb, layerAttrList, "palette_", Collections.<String> emptyList());
xb.beginElement("layer", layerAttrList);
// XForm
for (XForm xForm : layer.getXForms()) {
xb.emptyElement("xform", createXFormAttrList(xb, layer, xForm));
}
// FinalXForms
for (XForm xForm : layer.getFinalXForms()) {
xb.emptyElement("finalxform", createXFormAttrList(xb, layer, xForm));
}
// Palette
{
xb.beginElement("palette",
xb.createAttr("count", palette.getSize()),
xb.createAttr("format", "RGB"));
StringBuilder rgb = new StringBuilder();
for (int i = 0; i < palette.getSize(); i++) {
String hs;
hs = Integer.toHexString(palette.getColor(i).getRed()).toUpperCase();
rgb.append(hs.length() > 1 ? hs : "0" + hs);
hs = Integer.toHexString(palette.getColor(i).getGreen()).toUpperCase();
rgb.append(hs.length() > 1 ? hs : "0" + hs);
hs = Integer.toHexString(palette.getColor(i).getBlue()).toUpperCase();
rgb.append(hs.length() > 1 ? hs : "0" + hs);
if ((i + 1) % 12 == 0) {
rgb.append("\n");
}
}