1 | <?php namespace Arcanedev\Color; |
||
11 | class ColorConverter implements ColorConverterContract |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Traits |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | use Converters\HEXTrait, |
||
19 | Converters\HSVTrait; |
||
20 | |||
21 | /* ----------------------------------------------------------------- |
||
22 | | Main Methods |
||
23 | | ----------------------------------------------------------------- |
||
24 | */ |
||
25 | |||
26 | /** |
||
27 | * Convert a HEX color to an HSV array (alias). |
||
28 | * |
||
29 | * @see fromHexToHsv |
||
30 | * |
||
31 | * @param string $hex |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | 3 | public static function hexToHsv($hex) |
|
39 | |||
40 | /** |
||
41 | * Convert a HEX color to an HSV array. |
||
42 | * |
||
43 | * @param string $hex |
||
44 | * |
||
45 | * @return array |
||
46 | */ |
||
47 | 3 | public function fromHexToHsv($hex) |
|
53 | |||
54 | /** |
||
55 | * Convert an HSV to HEX color (alias). |
||
56 | * |
||
57 | * @see fromHsvToHex |
||
58 | * |
||
59 | * @param float|int $hue |
||
60 | * @param float|int $saturation |
||
61 | * @param float|int $value |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 3 | public static function hsvToHex($hue, $saturation, $value) |
|
69 | |||
70 | /** |
||
71 | * Convert an HSV to HEX color. |
||
72 | * |
||
73 | * @param float|int $hue |
||
74 | * @param float|int $saturation |
||
75 | * @param float|int $value |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | 3 | public function fromHsvToHex($hue, $saturation, $value) |
|
85 | } |
||
86 |