Box\Spout\Writer\Style\Style::getBackgroundColor PHP Method

getBackgroundColor() public method

public getBackgroundColor ( ) : string
return string
    public function getBackgroundColor()
    {
        return $this->backgroundColor;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Register a fill definition
  *
  * @param \Box\Spout\Writer\Style\Style $style
  */
 protected function registerFill($style)
 {
     $styleId = $style->getId();
     // Currently - only solid backgrounds are supported
     // so $backgroundColor is a scalar value (RGB Color)
     $backgroundColor = $style->getBackgroundColor();
     if ($backgroundColor) {
         $isBackgroundColorRegistered = isset($this->registeredFills[$backgroundColor]);
         // We need to track the already registered background definitions
         if ($isBackgroundColorRegistered) {
             $registeredStyleId = $this->registeredFills[$backgroundColor];
             $registeredFillId = $this->styleIdToFillMappingTable[$registeredStyleId];
             $this->styleIdToFillMappingTable[$styleId] = $registeredFillId;
         } else {
             $this->registeredFills[$backgroundColor] = $styleId;
             $this->styleIdToFillMappingTable[$styleId] = $this->fillIndex++;
         }
     } else {
         // The fillId maps a style to a fill declaration
         // When there is no background color definition - we default to 0
         $this->styleIdToFillMappingTable[$styleId] = 0;
     }
 }
All Usage Examples Of Box\Spout\Writer\Style\Style::getBackgroundColor