1 | <?php |
||
25 | class Color implements ComparableInterface |
||
26 | { |
||
27 | /* Colors */ |
||
28 | const COLOR_BLACK = 'FF000000'; |
||
29 | const COLOR_WHITE = 'FFFFFFFF'; |
||
30 | const COLOR_RED = 'FFFF0000'; |
||
31 | const COLOR_DARKRED = 'FF800000'; |
||
32 | const COLOR_BLUE = 'FF0000FF'; |
||
33 | const COLOR_DARKBLUE = 'FF000080'; |
||
34 | const COLOR_GREEN = 'FF00FF00'; |
||
35 | const COLOR_DARKGREEN = 'FF008000'; |
||
36 | const COLOR_YELLOW = 'FFFFFF00'; |
||
37 | const COLOR_DARKYELLOW = 'FF808000'; |
||
38 | |||
39 | /** |
||
40 | * ARGB - Alpha RGB |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $argb; |
||
45 | |||
46 | /** |
||
47 | * Hash index |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $hashIndex; |
||
52 | |||
53 | /** |
||
54 | * Create a new \PhpOffice\PhpPresentation\Style\Color |
||
55 | * |
||
56 | * @param string $pARGB |
||
57 | */ |
||
58 | 481 | public function __construct($pARGB = self::COLOR_BLACK) |
|
63 | |||
64 | /** |
||
65 | * Get ARGB |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | 15 | public function getARGB() |
|
73 | |||
74 | /** |
||
75 | * Set ARGB |
||
76 | * |
||
77 | * @param string $pValue |
||
78 | * @return \PhpOffice\PhpPresentation\Style\Color |
||
79 | */ |
||
80 | 3 | public function setARGB($pValue = self::COLOR_BLACK) |
|
89 | |||
90 | /** |
||
91 | * Get the alpha % of the ARGB |
||
92 | * Will return 100 if no ARGB |
||
93 | * @return integer |
||
94 | */ |
||
95 | 71 | public function getAlpha() |
|
104 | |||
105 | /** |
||
106 | * Set the alpha % of the ARGB |
||
107 | * @param int $alpha |
||
108 | * @return $this |
||
109 | */ |
||
110 | 156 | public function setAlpha($alpha = 100) |
|
124 | |||
125 | /** |
||
126 | 230 | * Get RGB |
|
127 | * |
||
128 | 230 | * @return string |
|
129 | 1 | */ |
|
130 | public function getRGB() |
||
138 | |||
139 | /** |
||
140 | * Set RGB |
||
141 | * |
||
142 | * @param string $pValue |
||
143 | * @param string $pAlpha |
||
144 | 118 | * @return \PhpOffice\PhpPresentation\Style\Color |
|
145 | */ |
||
146 | 118 | public function setRGB($pValue = '000000', $pAlpha = 'FF') |
|
158 | |||
159 | /** |
||
160 | 1 | * Get hash code |
|
161 | * |
||
162 | 1 | * @return string Hash code |
|
163 | */ |
||
164 | public function getHashCode() |
||
171 | |||
172 | /** |
||
173 | 1 | * Get hash index |
|
174 | * |
||
175 | 1 | * Note that this index may vary during script execution! Only reliable moment is |
|
176 | 1 | * while doing a write of a workbook and when changes are not allowed. |
|
177 | * |
||
178 | * @return string Hash index |
||
179 | */ |
||
180 | public function getHashIndex() |
||
184 | |||
185 | /** |
||
186 | * Set hash index |
||
187 | * |
||
188 | * Note that this index may vary during script execution! Only reliable moment is |
||
189 | * while doing a write of a workbook and when changes are not allowed. |
||
190 | * |
||
191 | * @param string $value Hash index |
||
192 | */ |
||
193 | public function setHashIndex($value) |
||
197 | } |
||
198 |