NPOIExcel单元格颜色对照表,在引用了NPOI.dll后可通过ICellStyle接口的FillForegroundColor属性实现Excel单元格的背景色设置,FillPattern为单元格背景色的填充样式。NPOIExcel单元格背景颜色设置方法以及颜色对照表:123456ICellStylestyle=workbook.CreateCellStyle();style.FillForegroundColor=NPOI.HSSF.Util.HSSFColor.Red.Index;style.FillPattern=FillPattern.SolidForeground;ICellcell=workbook.CreateSheet().CreateRow(0).CreateCell(0);cell.CellStyle=style;复制颜色对照表:颜色测试Class名称shortTest颜色Black8Test颜色Brown60Test颜色Olive_Green59Test颜色Dark_Green58Test颜色Dark_Teal56Test颜色Dark_Blue18Test颜色Indigo62Test颜色Grey_80_PERCENT63Test颜色Dark_Red16Test颜色Orange53Test颜色DARK_YELLOW19Test颜色Green17Test颜色Teal21Test颜色Blue12Test颜色Blue_Grey54Test颜色Grey_50_PERCENT23Test颜色Red10Test颜色LIGHT_ORANGE52Test颜色LIME50Test颜色SEA_GREEN57Test颜色AQUA49Test颜色LIGHT_BLUE48Test颜色VIOLET20Test颜色GREY_40_PERCENT55Test颜色Pink14Test颜色Gold51Test颜色Yellow13Test颜色BRIGHT_GREEN11Test颜色TURQUOISE15Test颜色SKY_BLUE40Test颜色Plum61Test颜色GREY_25_PERCENT22Test颜色Rose45Test颜色Tan47Test颜色LIGHT_YELLOW43Test颜色LIGHT_GREEN42Test颜色LIGHT_TURQUOISE41Test颜色PALE_BLUE44Test颜色LAVENDER46Test颜色White9Test颜色CORNFLOWER_BLUE24Test颜色LEMON_CHIFFON26Test颜色MAROON25Test颜色ORCHID28Test颜色CORAL29Test颜色ROYAL_BLUE30Test颜色LIGHT_CORNFLOWER_BLUE31Test颜色AUTOMATIC64