private Color getColor(Element shape) { Color color; if (shape.hasAttribute(ATR_COLOUR)) { String s = shape.getAttribute(ATR_COLOUR); if (s.indexOf(',') > -1) { String[] rgb = s.split(","); color = new Color( Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])); } else { color = new Color(Integer.parseInt(s)); } } else color = IMPLIED_COLOR; if (shape.hasAttribute(ATR_TRANSPARENCY)) { int alpha = Integer.parseInt(shape.getAttribute(ATR_TRANSPARENCY)); if (alpha < 255) return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha); } return color; }