diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to '')
-rw-r--r-- | vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php new file mode 100644 index 0000000..0b6ad6e --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php @@ -0,0 +1,36 @@ +<?php
+
+namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
+
+use PhpOffice\PhpSpreadsheet\Reader\Xls;
+
+class Color
+{
+ /**
+ * Read color.
+ *
+ * @param int $color Indexed color
+ * @param array $palette Color palette
+ * @param int $version
+ *
+ * @return array RGB color value, example: ['rgb' => 'FF0000']
+ */
+ public static function map($color, $palette, $version)
+ {
+ if ($color <= 0x07 || $color >= 0x40) {
+ // special built-in color
+ return Color\BuiltIn::lookup($color);
+ } elseif (isset($palette, $palette[$color - 8])) {
+ // palette color, color index 0x08 maps to pallete index 0
+ return $palette[$color - 8];
+ }
+
+ // default color table
+ if ($version == Xls::XLS_BIFF8) {
+ return Color\BIFF8::lookup($color);
+ }
+
+ // BIFF5
+ return Color\BIFF5::lookup($color);
+ }
+}
|