title: NPOI does not change cell´s font color
body: <p>I am trying to change a cell's font color conditionally. This is my last try:</p>
  
  <pre><code>IWorkbook wb = null;
  
  using (FileStream _fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
  {
      wb = WorkbookFactory.Create(_fileStream);
      _fileStream.Close();
  }
  
  
  
  ISheet sheet = wb.GetSheet(sheetName);
  IFont font = wb.CreateFont();
  ...
  ...
  
  // within a loop
  ICell cell = sheet.GetRow(r).GetCell(col);
  if (integrity &lt; 1)
  {
      ICellStyle redStyle = cell.CellStyle;
      font.Color = IndexedColors.Red.Index;
      redStyle.SetFont(font);
      cell.CellStyle = redStyle;
  }
  else
  {
      ICellStyle normalStyle = cell.CellStyle;
      font.Color = XSSFFont.DEFAULT_FONT_COLOR;
      normalStyle.SetFont(font);
      cell.CellStyle = normalStyle;
  }                        
  </code></pre>
  
  <p>However, the font does not change when the condition is met. It seems like the style is applied for all cells instead of the cell I am getting within the loop. I have read some questions related to this problem but I can not make it work.</p>
  
  <p>This new try is formatting all cells. No matter whether it meets the condition or not</p>
  
  <pre><code>ICellStyle redStyle = cell.CellStyle;
  font.Color = IndexedColors.Red.Index;             
  redStyle.SetFont(font);    
  
  //This is how I am trying to change cells format 
  if (integrity &lt; 1)
  {
      cell.CellStyle.SetFont(font);
  } 
  </code></pre>
  
  <p>Joao response would format all cells with a "normalStyle"</p>