I am trying to set background color of a call based on cell value, But i am getting error when i use the below code
function bgColor($cell,$color){
global $F;
$F->getStyle($cell)->applyFromArray(
array(
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'startcolor' => array('rgb' => $color),
'endcolor' => array('rgb' => $color)
//'color' => array('argb' => $color)
)
)
);
}
if i use rgb the following error occurs
Repaired Part: /xl/styles.xml part with XML error. (Styles) Load error. Line 2, column 934. Removed Feature: Format from /xl/styles.xml part (Styles) Removed Records: Style from /xl/styles.xml part (Styles)
if i use argb the first cell is filled with black color, while the argument passed to the color is yellow.
Ca anyone please tell me what i am doing wrong here