C#-NPOI自定义颜色

ICellStyle s = workbook.CreateCellStyle();
s.FillForegroundColor = 0;
s.FillPattern = FillPattern.SolidForeground;                                 
((XSSFColor)s.FillForegroundColorColor).SetRgb(new byte[] { 252, 139, 139 });

旧的版本:

ICellStyle s = workbook.CreateCellStyle();
s.FillForegroundColor = 0;
s.FillPattern = FillPatternType.SOLID_FOREGROUND;
((XSSFColor)s.FillForegroundColorColor).SetRgb(new byte[] {252, 139, 139});
posted @ 2019-09-04 15:49  陈鹏昱Chen  阅读(1389)  评论(0编辑  收藏  举报