wrapper/Excel.php
public function backgroundCell($color, $cell=null, $row=null){
        $color = str_replace("#", "", $color);
        if(!is_null($cell)){
            $this->x = $this->getColumnName($cell);
            $this->y = $row;
        }

        $style = array('fill' => array(
            'type' => PHPExcel_Style_Fill::FILL_SOLID,
            'color' => array('rgb' => "$color")
        )
        );
        $this->engine->getActiveSheet()->getStyle("{$this->x}{$this->y}")->applyFromArray($style);
    }
public function backgroundCell($color, $cell=null, $row=null){
        $color = str_replace("#", "", $color);
        if(!is_null($cell)){
            $this->x = $this->getColumnName($cell);
            $this->y = $row;
        }

        $style = array('fill' => array(
            'type' => PHPExcel_Style_Fill::FILL_SOLID,
            'color' => array('rgb' => "$color")
        )
        );
        $this->engine->getActiveSheet()->getStyle("{$this->x}{$this->y}")->applyFromArray($style);
    }
public function backgroundCell ( $ color , $ cell = null , $ row = null ) { $ color = str_replace ( "#" , "" , $ color ) ; if ( ! is_null ( $ cell ) ) { $ this -> x = $ this -> getColumnName ( $ cell ) ; $ this -> y = $ row ; } $ style = array ( 'fill' => array ( 'type' => PHPExcel_Style_Fill :: FILL_SOLID , 'color' => array ( 'rgb' => "$color" ) ) ) ; $ this -> engine -> getActiveSheet ( ) -> getStyle ( "{$this->x}{$this->y}" ) -> applyFromArray ( $ style ) ; }
Set background color for a cell
@param string    $color color in hexadecimal
@param int $cell  cell position
@param int $row   row position
@return void
Set background color for a cell