You are here

private static function PHPExcel_Reader_Excel5::_readRGB in Loft Data Grids 7.2

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

* Extract RGB color * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4 * *

Parameters

string $rgb Encoded RGB value (4 bytes): * @return array

1 call to PHPExcel_Reader_Excel5::_readRGB()
PHPExcel_Reader_Excel5::_readPalette in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Read PALETTE record

File

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

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private static function _readRGB($rgb) {

  // offset: 0; size 1; Red component
  $r = ord($rgb[0]);

  // offset: 1; size: 1; Green component
  $g = ord($rgb[1]);

  // offset: 2; size: 1; Blue component
  $b = ord($rgb[2]);

  // HEX notation, e.g. 'FF00FC'
  $rgb = sprintf('%02X%02X%02X', $r, $g, $b);
  return array(
    'rgb' => $rgb,
  );
}