本文整理了Java中org.apache.poi.hssf.util.HSSFColor.getTriplet()
方法的一些代码示例,展示了HSSFColor.getTriplet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFColor.getTriplet()
方法的具体详情如下:
包路径:org.apache.poi.hssf.util.HSSFColor
类名称:HSSFColor
方法名:getTriplet
暂无
代码示例来源:origin: org.apache.poi/poi
/**
* @see HSSFColor#getTriplet()
*/
public short [] getTriplet() {
return color.getTriplet();
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* @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]};
}
代码示例来源:origin: org.apache.poi/poi
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;
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
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);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* @see HSSFColor#getTriplet()
*/
public short [] getTriplet() {
return color.getTriplet();
}
代码示例来源:origin: stackoverflow.com
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(");");
}
}
代码示例来源:origin: org.jeecg/easypoi-base
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]);
}
}
代码示例来源:origin: org.apache.poi/poi-contrib
/**
* 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]);
}
}
代码示例来源:origin: org.apache.poi/poi-contrib
private static final Color getAWTColor(HSSFColor clr) {
short[] rgb = clr.getTriplet();
return new Color(rgb[0],rgb[1],rgb[2]);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* 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]);
}
}
代码示例来源:origin: cn.afterturn/easypoi-base
@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]);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
private static final Color getAWTColor(HSSFColor clr) {
short[] rgb = clr.getTriplet();
return new Color(rgb[0],rgb[1],rgb[2]);
}
}
代码示例来源:origin: br.com.tecsinapse/tecsinapse-data-io
public static String toHexColor(HSSFColor hssfColor) {
short[] rgb = hssfColor.getTriplet();
return String.format("#%02X%02X%02X", rgb[0], rgb[1], rgb[2]);
}
}
代码示例来源:origin: zhangdaiscott/jeasypoi
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]);
}
}
代码示例来源:origin: org.apache.poi/poi-examples
/** 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]);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* @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]};
}
代码示例来源:origin: stackoverflow.com
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;
}
代码示例来源:origin: cn.afterturn/easypoi-base
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);
}
}
代码示例来源:origin: org.jeecg/easypoi-base
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);
}
}
代码示例来源:origin: org.apache.poi/poi-examples
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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!