POI Excel cell background Color setting method and color comparison table:
Copy
123456 |
ICellStyle style = workbook.CreateCellStyle(); style.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Red.Index; style.FillPattern = FillPattern.SolidForeground; ICell cell = workbook.CreateSheet().CreateRow(0).CreateCell(0); cell.CellStyle = style; |
Color table:
Color |
Test |
Class name |
Short |
|
|
|
|
|
Test color |
Black |
8 |
|
Test color |
Brown |
60 |
|
Test color |
Olive_green |
59 |
|
Test color |
Dark_green |
58 |
|
Test color |
Dark_teal |
56 |
|
Test color |
Dark_blue |
18 |
|
Test color |
Indigo |
62 |
|
Test color |
Grey_80_percent |
63 |
|
Test color |
Dark_red |
16 |
|
Test color |
Orange |
53 |
|
Test color |
Dark_yellow |
19 |
|
Test color |
Green |
17 |
|
Test color |
Teal |
21st |
|
Test color |
Blue |
12 |
|
Test color |
Blue_grey |
54 |
|
Test color |
Grey_50_percent |
23 |
|
Test color |
Red |
10 |
|
Test color |
Light_orange |
52 |
|
Test color |
LIME |
50 |
|
Test color |
Sea_green |
57 |
|
Test color |
AQUA |
49 |
|
Test color |
Light_blue |
48 |
|
Test color |
VIOLET |
20 |
|
Test color |
Grey_40_percent |
55 |
|
Test color |
Pink |
14 |
|
Test color |
Gold |
51 |
|
Test color |
Yellow |
13 |
|
Test color |
Bright_green |
11 |
|
Test color |
Turquoise |
15 |
|
Test color |
Sky_blue |
40 |
|
Test color |
Plum |
61 |
|
Test color |
Grey_25_percent |
22 |
|
Test color |
Rose |
45 |
|
Test color |
Tan |
47 |
|
Test color |
Light_yellow |
43 |
|
Test color |
Light_green |
42 |
|
Test color |
Light_turquoise |
41 |
|
Test color |
Pale_blue |
44 |
|
Test color |
LAVENDER |
46 |
|
Test color |
White |
9 |
|
Test color |
Cornflower_blue |
24 |
|
Test color |
Lemon_chiffon |
26 |
|
Test color |
Maroon |
25 |
|
Test color |
ORCHID |
28 |
|
Test color |
CORAL |
29 |
|
Test color |
Royal_blue |
30 |
|
Test color |
Light_cornflower_blue |
31 |
|
Test color |
AUTOMATIC |
64 |
Npoi Excel Cell background color comparison table