/** * @see HSSFColor#getTriplet() */ public short [] getTriplet() { return color.getTriplet(); }
/** * @param index * @return RGB bytes from HSSF default color by index */ public static byte[] getDefaultRGB(int index) { HSSFColor hssfColor = HSSFColor.getIndexHash().get(index); if (hssfColor == null) return null; short[] rgbShort = hssfColor.getTriplet(); return new byte[] {(byte) rgbShort[0], (byte) rgbShort[1], (byte) rgbShort[2]}; }
protected byte[] getIndexedRGB() { if (isIndexed() && getIndex() > 0) { int indexNum = getIndex(); HSSFColor indexed = HSSFColor.getIndexHash().get(indexNum); if (indexed != null) { byte[] rgb = new byte[3]; rgb[0] = (byte) indexed.getTriplet()[0]; rgb[1] = (byte) indexed.getTriplet()[1]; rgb[2] = (byte) indexed.getTriplet()[2]; return rgb; } } // else return null; } }
if (indexed != null) { byte[] rgb = new byte[3]; rgb[0] = (byte) indexed.getTriplet()[0]; rgb[1] = (byte) indexed.getTriplet()[1]; rgb[2] = (byte) indexed.getTriplet()[2]; CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(rgb);
/** * @see HSSFColor#getTriplet() */ public short [] getTriplet() { return color.getTriplet(); }
final HSSFColor foreColor = palette.getColor(style.getFont(this.book).getColor()); if (foreColor != null) { final short[] foreRGB = foreColor.getTriplet(); if (foreRGB[0] != 0 || foreRGB[1] != 0 || foreRGB[2] != 0) { out.append("color: rgb(").append(foreRGB[0]).append(',').append(foreRGB[1]).append(',').append(foreRGB[2]).append(");"); } }
public void styleColor(Formatter out, String attr, Color color) { if (color == null) { return; } HSSFColor hSSFColor = (HSSFColor) color; short[] rgb = hSSFColor.getTriplet(); out.format(" %s: #%02x%02x%02x; %n", attr, rgb[0], rgb[1], rgb[2]); } }
/** * Gets the aWTColor attribute of the SVTableUtils class * * @param clr Description of the Parameter * @return The aWTColor value */ public final static Color getAWTColor(HSSFColor clr) { short[] rgb = clr.getTriplet(); return new Color(rgb[0], rgb[1], rgb[2]); } }
private static final Color getAWTColor(HSSFColor clr) { short[] rgb = clr.getTriplet(); return new Color(rgb[0],rgb[1],rgb[2]); } }
/** * Gets the aWTColor attribute of the SVTableUtils class * * @param clr Description of the Parameter * @return The aWTColor value */ public final static Color getAWTColor(HSSFColor clr) { short[] rgb = clr.getTriplet(); return new Color(rgb[0], rgb[1], rgb[2]); } }
@Override public void styleColor(Formatter out, String attr, Color color) { if (color == null) { return; } HSSFColor hSSFColor = (HSSFColor) color; short[] rgb = hSSFColor.getTriplet(); out.format(" %s: #%02x%02x%02x; %n", attr, rgb[0], rgb[1], rgb[2]); } }
private static final Color getAWTColor(HSSFColor clr) { short[] rgb = clr.getTriplet(); return new Color(rgb[0],rgb[1],rgb[2]); } }
public static String toHexColor(HSSFColor hssfColor) { short[] rgb = hssfColor.getTriplet(); return String.format("#%02X%02X%02X", rgb[0], rgb[1], rgb[2]); } }
public void styleColor(Formatter out, String attr, Color color) { if (color == null) { return; } HSSFColor hSSFColor = (HSSFColor) color; short[] rgb = hSSFColor.getTriplet(); out.format(" %s: #%02x%02x%02x; %n", attr, rgb[0], rgb[1], rgb[2]); } }
/** This method retrieves the AWT Color representation from the colour hash table * */ /* package */ static Color getAWTColor(int index, Color deflt) { HSSFColor clr = colors.get(index); if (clr == null) { return deflt; } short[] rgb = clr.getTriplet(); return new Color(rgb[0],rgb[1],rgb[2]); }
/** * @param index * @return RGB bytes from HSSF default color by index */ public static byte[] getDefaultRGB(int index) { HSSFColor hssfColor = HSSFColor.getIndexHash().get(index); if (hssfColor == null) return null; short[] rgbShort = hssfColor.getTriplet(); return new byte[] {(byte) rgbShort[0], (byte) rgbShort[1], (byte) rgbShort[2]}; }
Cell cell = row.getCell(1); CellStyle cellStyle = cell.getCellStyle(); System.out.println("color = " + getColorPattern(cellStyle.getFillForegroundColor())); private short[] getColorPattern(short colorIdx){ short[] triplet = null; HSSFColor color = palette.getColor(colorIdx); triplet = color.getTriplet(); System.out.println("color : " + triplet[0] +"," + triplet[1] + "," + triplet[2]); return triplet; }
private void styleColor(Formatter out, String attr, short index) { HSSFColor color = colors.getColor(index); if (index == hssfAuto.getIndex() || color == null) { out.format(" /* %s: index = %d */%n", attr, index); } else { short[] rgb = color.getTriplet(); out.format(" %s: #%02x%02x%02x; /* index = %d */%n", attr, rgb[0], rgb[1], rgb[2], index); } }
private void styleColor(Formatter out, String attr, short index) { HSSFColor color = colors.getColor(index); if (index == HSSF_AUTO.getIndex() || color == null) { out.format(" /* %s: index = %d */%n", attr, index); } else { short[] rgb = color.getTriplet(); out.format(" %s: #%02x%02x%02x; /* index = %d */%n", attr, rgb[0], rgb[1], rgb[2], index); } }
private void styleColor(Formatter out, String attr, short index) { HSSFColor color = colors.getColor(index); if (index == HSSF_AUTO.getIndex() || color == null) { out.format(" /* %s: index = %d */%n", attr, index); } else { short[] rgb = color.getTriplet(); out.format(" %s: #%02x%02x%02x; /* index = %d */%n", attr, rgb[0], rgb[1], rgb[2], index); } } }