title: Set RGB background-color of an Excel cell with Apache POI
body: <p>i am trying copy cells from one row to the one below. To copy the comments and cellvalues works fine. Now if I set a background-color in Excel and want to just copy it to the new cell, it doesn't work. Either there is just no color after copying or the background is black.
  I tried that:</p>
  
  <pre><code>style2.setFillBackgroundColor(cell_master_alt.getCellStyle().getFillBackgroundColor());
  style2.setFillForegroundColor(cell_master_alt.getCellStyle().getFillForegroundColor());
  
  style2.setFillPattern(CellStyle.SOLID_FOREGROUND);    or
  style2.setFillPattern(cell_master_alt.getCellStyle().getFillPattern());
  
  cell_master_neu.setCellStyle(style2);
  </code></pre>
  
  <p>After a few hours without any progress, I looked into the foreground- and background-color of the cell I want to copy. There I found RGB values. Now I want to make a new Cellstyle with that values, but that doesn't work as well.
  First I try this: </p>
  
  <pre><code>style_new.setFillForegroundColor(new XSSFColor(new java.awt.Color(128,128,128)));
  </code></pre>
  
  <p>but there is an error message: </p>
  
  <pre><code>The method setFillForegroundColor(short) in the type CellStyle is not applicable for the arguments (XSSFColor)
  </code></pre>
  
  <p>What is wrong with that?</p>
  
  <p>Thanks </p>