@@ 229-235 (lines=7) @@ | ||
226 | * @param array $color Array with offsets 'h', 's', 'l' |
|
227 | * @return void |
|
228 | */ |
|
229 | public function import_hsl(array $color) { |
|
230 | regulate::hsl_array($color); |
|
231 | $this->rgb = convert\hsl::to_rgb($color); |
|
232 | $this->hsl = new hsl($this->rgb); // [todo] This should taken from input |
|
233 | $this->hex = convert\rgb::to_hex($this->rgb); |
|
234 | $this->import_alpha($color); |
|
235 | } |
|
236 | ||
237 | /** |
|
238 | * Imports a hsb array. |
|
@@ 243-249 (lines=7) @@ | ||
240 | * @param array $color Array with offsets 'h', 's', 'b' |
|
241 | * @return void |
|
242 | */ |
|
243 | public function import_hsb(array $color) { |
|
244 | regulate::hsb_array($color); |
|
245 | $this->rgb = convert\hsb::to_rgb($color); |
|
246 | $this->hsl = new hsl($this->rgb); |
|
247 | $this->hex = convert\rgb::to_hex($this->rgb); |
|
248 | $this->import_alpha($color); |
|
249 | } |
|
250 | ||
251 | /** |
|
252 | * Converts a hexadecimal string into an RGB array and imports it. |