You are here

public function PHPExcel_Style_Color::setRGB in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Color.php \PHPExcel_Style_Color::setRGB()

* Set RGB * *

Parameters

string $pValue RGB value: * @return PHPExcel_Style_Color

1 call to PHPExcel_Style_Color::setRGB()
PHPExcel_Style_Color::applyFromArray in vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Color.php
* Apply styles from array * * <code> * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') ); * </code> * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Color.php, line 227

Class

PHPExcel_Style_Color
PHPExcel_Style_Color

Code

public function setRGB($pValue = '000000') {
  if ($pValue == '') {
    $pValue = '000000';
  }
  if ($this->_isSupervisor) {
    $styleArray = $this
      ->getStyleArray(array(
      'argb' => 'FF' . $pValue,
    ));
    $this
      ->getActiveSheet()
      ->getStyle($this
      ->getSelectedCells())
      ->applyFromArray($styleArray);
  }
  else {
    $this->_argb = 'FF' . $pValue;
  }
  return $this;
}