Ejemplo n.º 1
0
 /**
  * Write Pattern Fill
  *
  * @param 	Shared_XMLWriter			$objWriter 		XML Writer
  * @param 	Style_Fill					$pFill			Fill style
  * @throws 	Exception
  */
 private function _writePatternFill(Shared_XMLWriter $objWriter = null, Style_Fill $pFill = null)
 {
     // fill
     $objWriter->startElement('fill');
     // patternFill
     $objWriter->startElement('patternFill');
     $objWriter->writeAttribute('patternType', $pFill->getFillType());
     // fgColor
     $objWriter->startElement('fgColor');
     $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
     $objWriter->endElement();
     // bgColor
     $objWriter->startElement('bgColor');
     $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
 }
Ejemplo n.º 2
0
 /**
  * Create CSS style (Style_Fill)
  *
  * @param	Style_Fill		$pStyle			Style_Fill
  * @return	array
  */
 private function _createCSSStyleFill(Style_Fill $pStyle)
 {
     // Construct HTML
     $css = array();
     // Create CSS
     $value = $pStyle->getFillType() == Style_Fill::FILL_NONE ? 'white' : '#' . $pStyle->getStartColor()->getRGB();
     $css['background-color'] = $value;
     // Return
     return $css;
 }