1 | <?php namespace Arcanedev\Color\Converters; |
||
9 | trait HEXTrait |
||
10 | { |
||
11 | /* ------------------------------------------------------------------------------------------------ |
||
12 | | Main Functions |
||
13 | | ------------------------------------------------------------------------------------------------ |
||
14 | */ |
||
15 | /** |
||
16 | * Convert a HEX color to an RGB array (alias). |
||
17 | * |
||
18 | * @see fromHexToRgb |
||
19 | * |
||
20 | * @param string $hex |
||
21 | * |
||
22 | * @return array |
||
23 | */ |
||
24 | 16 | public static function hexToRgb($hex) |
|
28 | |||
29 | /** |
||
30 | * Convert a HEX color to an RGB array. |
||
31 | * |
||
32 | * @param string $hex |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | 24 | public function fromHexToRgb($hex) |
|
50 | |||
51 | /** |
||
52 | * Convert RGB values to a HEX color (alias). |
||
53 | * |
||
54 | * @see fromRgbToHex |
||
55 | * |
||
56 | * @param int $red |
||
57 | * @param int $green |
||
58 | * @param int $blue |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 16 | public static function rgbToHex($red, $green, $blue) |
|
66 | |||
67 | /** |
||
68 | * Convert RGB values to a HEX color. |
||
69 | * |
||
70 | * @param int $red |
||
71 | * @param int $green |
||
72 | * @param int $blue |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function fromRgbToHex($red, $green, $blue) |
||
82 | } |
||
83 |