public static Color getBorderColor(CTBorder border) { if (border == null) { return null; } // border.getColor returns object???, use attribute w:color to get // the color. Node colorAttr = border.getDomNode().getAttributes().getNamedItemNS(MAIN_NAMESPACE, "color"); if (colorAttr != null) { Object val = border.getVal(); return ColorHelper.getColor(((Attr) colorAttr).getValue(), val, false); } return null; }