EasyExcel 注解fillForegroundColor 對應的顏色值
/**
?* 樣式的數據類
?*
?* @author leiyiDong
?**/
@Data
// 頭背景設置成紅色 IndexedColors.RED.getIndex()
@HeadStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 10)
// 頭字體設置成20
@HeadFontStyle(fontHeightInPoints = 20)
// 內容的背景設置成綠色 IndexedColors.GREEN.getIndex()
@ContentStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 17)
// 內容字體設置成20
@ContentFontStyle(fontHeightInPoints = 20)
public class DemoStyleData {
? ? // 字符串的頭背景設置成粉紅 IndexedColors.PINK.getIndex()
? ? @HeadStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 14)
? ? // 字符串的頭字體設置成20
? ? @HeadFontStyle(fontHeightInPoints = 30)
? ? // 字符串的內容的背景設置成天藍 IndexedColors.SKY_BLUE.getIndex()
? ? @ContentStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 40)
? ? // 字符串的內容字體設置成20
? ? @ContentFontStyle(fontHeightInPoints = 30)
? ? @ExcelProperty("字符串標題")
? ? private String string;
? ? @ExcelProperty("日期標題")
? ? private Date date;
? ? @ExcelProperty("數字標題")
? ? private Double doubleData;
}
fillForegroundColor 對應的顏色值如下圖:
?
easy-excel
【參考:EasyExcel 注解fillForegroundColor 對應的顏色值】
?