示例#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();
     } 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';
 }