You are here

private function PHPExcel_Reader_Excel5::_readPalette in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php \PHPExcel_Reader_Excel5::_readPalette()

* Read PALETTE record

1 call to PHPExcel_Reader_Excel5::_readPalette()
PHPExcel_Reader_Excel5::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Loads PHPExcel from file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php, line 2512

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readPalette() {
  $length = self::_GetInt2d($this->_data, $this->_pos + 2);
  $recordData = $this
    ->_readRecordData($this->_data, $this->_pos + 4, $length);

  // move stream pointer to next record
  $this->_pos += 4 + $length;
  if (!$this->_readDataOnly) {

    // offset: 0; size: 2; number of following colors
    $nm = self::_GetInt2d($recordData, 0);

    // list of RGB colors
    for ($i = 0; $i < $nm; ++$i) {
      $rgb = substr($recordData, 2 + 4 * $i, 4);
      $this->_palette[] = self::_readRGB($rgb);
    }
  }
}