示例#1
0
 private static function readColor($color, $background = false)
 {
     if (isset($color["rgb"])) {
         return (string) $color["rgb"];
     } elseif (isset($color["indexed"])) {
         return \PHPExcel\Style\Color::indexedColor($color["indexed"] - 7, $background)->getARGB();
     }
 }
示例#2
0
 /**
  * Get hash code
  *
  * @return string    Hash code
  */
 public function getHashCode()
 {
     return md5(($this->visible ? 't' : 'f') . $this->blurRadius . $this->distance . $this->direction . $this->alignment . $this->color->getHashCode() . $this->alpha . __CLASS__);
 }
示例#3
0
 private static function readColor($color, $background = false)
 {
     if (isset($color["rgb"])) {
         return (string) $color["rgb"];
     } elseif (isset($color["indexed"])) {
         return \PHPExcel\Style\Color::indexedColor($color["indexed"] - 7, $background)->getARGB();
     } elseif (isset($color["theme"])) {
         if (self::$theme !== null) {
             $returnColour = self::$theme->getColourByIndex((int) $color["theme"]);
             if (isset($color["tint"])) {
                 $tintAdjust = (double) $color["tint"];
                 $returnColour = \PHPExcel\Style\Color::changeBrightness($returnColour, $tintAdjust);
             }
             return 'FF' . $returnColour;
         }
     }
     if ($background) {
         return 'FFFFFFFF';
     }
     return 'FF000000';
 }