title: How do I get the (Java Apache POI HSSF) Background Color for a given cell?
body: <p>I have an existing excel spreadsheet, which I am accesssing and reading values from, I am using Apache POI HSSF.</p>
  
  <p>It is initialised like this:</p>
  
  <pre><code>HSSFSheet sheet;
  FileInputStream fis = new FileInputStream(this.file);
  POIFSFileSystem fs = new POIFSFileSystem(fis);
  HSSFWorkbook wb = new HSSFWorkbook(fs);
  this.sheet = wb.getSheet(exsheet);
  </code></pre>
  
  <p>I am iterating over all the cells that exist in the sheet, which makes a cell object:</p>
  
  <pre><code>HSSFCell cell = (HSSFCell) cells.next();
  </code></pre>
  
  <p>Please can someone familiar with the framework explain how to create an (HSSFColor) object to represent the backround color of each cell in the sheet.</p>
  
  <p>Many thanks</p>
  
  <p><strong>EDIT, UPDATE</strong> </p>
  
  <p>To be clear what I want to know is: how do I create/get an <strong>HSSFColor</strong> object for the background color of an existing cell?</p>
  
  <pre><code>cell.getCellStyle().getFillBackgroundColor(); 
  </code></pre>
  
  <p>This code only returns a short number, not an HSSFColor object.
  Thanks for the answers so far.</p>