Skip to content

Instantly share code, notes, and snippets.

@donma
Created August 7, 2018 09:06
Show Gist options
  • Save donma/729fd373dc053159630aee8b7fe11fbf to your computer and use it in GitHub Desktop.
Save donma/729fd373dc053159630aee8b7fe11fbf to your computer and use it in GitHub Desktop.
NPOI Font Color Part Code 1
//綠色的Style
NPOI.SS.UserModel.IFont fontG = workbook.CreateFont();
fontG.Color = NPOI.SS.UserModel.IndexedColors.Green.Index;
var styleG = workbook.CreateCellStyle();
styleG.SetFont(fontG);
//紅色的Style
NPOI.SS.UserModel.IFont fontR = workbook.CreateFont();
fontR.Color = NPOI.SS.UserModel.IndexedColors.Red.Index;
var styleR = workbook.CreateCellStyle();
styleR.SetFont(fontR);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment