1
Excel 표를 HTML로 변환 중입니다. Java에서 POI를 사용하여 xls 통합 문서의 셀 색상을 가져옵니다. 문제는 색상이 일치하지 않는다는 것입니다. Excel에서 242, 220 및 219의 RGB 값을 가졌지 만 POI를 사용하여 RGB 값을 얻으면 RGB (255,153,204)가됩니다.Java에서 POI를 사용하여 Excel 셀 배경색을 얻지 못함
정확한 색상을 얻는 방법에 대한 아이디어가 있으십니까?
HSSFCellStyle cs = (HSSFCellStyle) style;
out.format(" /* fill pattern = %d */%n", cs.getFillPattern());
styleColorback(out, "background-color", cs.getFillForegroundColorColor())
private void styleColorback(Formatter out, String attr, HSSFColor color) {
short[] rgb = color.getTriplet();
out.format(" %s: #%02x%02x%02x; ", attr, rgb[0], rgb[1], rgb[2]);
}