title: How can I get the RGB value of a given cell in a xlsx file using python?
body: <p>Given a row and a column (plus sheet name) I need a way to extract the rgb value for a cell, as reported within excel, from a python script.</p>
  
  <p>I've been using openpyxl. The following do not work consistently:</p>
  
  <pre><code>cell.fill.fgColor.rgb
  cell.fill.bgColor.rgb
  </code></pre>
  
  <p>The following give the wrong value:</p>
  
  <pre><code>openpyxl.styles.colors.COLOR_INDEX[cell.fill.fgColor.index]
  openpyxl.styles.colors.COLOR_INDEX[cell.fill.fgColor.index]
  </code></pre>
  
  <p>So I'm looking for another way to do it. Possible solutions need not be limited to the openpyxl library, as I'm willing to use another one.</p>