title: box/spout - Massive memory usage when using hex color vs pre-defined colors
body: <p>I'm using the <a href="http://opensource.box.com/spout/" rel="nofollow noreferrer">Box/Spout</a> library and it seems that using StyleBuilder with a custom hex color (e.g. 0000FF for blue) uses a ton of memory compared to using pre-defined colors such as Color::BLUE. Why would that be?</p>
  
  <p><strong>Relevant snippet:</strong></p>
  
  <pre><code>//LOW MEMORY
  $row[] = WriterEntityFactory::createCell('test', (new StyleBuilder())-&gt;setFontColor(Color::BLUE)-&gt;build());
  
  //HIGH MEMORY
  $row[] = WriterEntityFactory::createCell('test', (new StyleBuilder())-&gt;setFontColor($colorHex)-&gt;build());
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <p>setFontColor(Color::BLUE): <code>Peak memory usage: 1666 KB</code></p>
  
  <p>setFontColor($colorHex): <code>Peak memory usage: 189436 KB</code></p>
  
  <p><strong>Full code:</strong></p>
  
  <p>(For demo purposes I'm loading a small 250x150 image to provide multiple color values)</p>
  
  <pre><code>&lt;?php
  
      require_once 'Spout/Autoloader/autoload.php';
      use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
      use Box\Spout\Common\Entity\Style\Color;
      use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
  
      //load an image
      $img = imagecreatefrompng('input/test250x150.png');
  
      $writer = WriterEntityFactory::createXLSXWriter();
      $writer-&gt;openToFile('output/MyExcel.xlsx');
  
      //height of the image
      for($y=0; $y&lt;150; $y++) {
  
          //create or reset array to hold this row's cells
          $row = [];
  
          //width of the image
          for($x=0; $x&lt;250; $x++) {
  
              //gets the pixel color
              $index = imagecolorat($img, $x, $y);
              $colorRGBArr = imagecolorsforindex($img, $index);
              $colorHex = sprintf("%02x%02x%02x", $colorRGBArr['red'], $colorRGBArr['green'], $colorRGBArr['blue']);
  
              //LOW MEMORY
              //$row[] = WriterEntityFactory::createCell('test', (new StyleBuilder())-&gt;setFontColor(Color::BLUE)-&gt;build());
              //HIGH MEMORY
              $row[] = WriterEntityFactory::createCell('test', (new StyleBuilder())-&gt;setFontColor($colorHex)-&gt;build());
  
          }
          $writer-&gt;addRow(WriterEntityFactory::createRow($row));
      }
  
      $writer-&gt;close();
  
      echo 'Peak memory usage: '.round(memory_get_peak_usage() / 1024).' KB';
  ?&gt;
  </code></pre>