1 | <?php |
||
4 | class Color { |
||
5 | |||
6 | /** @var int */ |
||
7 | private $red; |
||
8 | |||
9 | /** @var int */ |
||
10 | private $green; |
||
11 | |||
12 | /** @var int */ |
||
13 | private $blue; |
||
14 | |||
15 | /** |
||
16 | * @param int $red |
||
17 | * @param int $green |
||
18 | * @param int $blue |
||
19 | */ |
||
20 | public function __construct($red, $green, $blue) { |
||
25 | |||
26 | public static function fromHex($hexString) { |
||
30 | |||
31 | public function asHex() { |
||
37 | |||
38 | /** |
||
39 | * @return int |
||
40 | */ |
||
41 | public function getRed() { |
||
44 | |||
45 | /** |
||
46 | * @return int |
||
47 | */ |
||
48 | public function getGreen() { |
||
51 | |||
52 | /** |
||
53 | * @return int |
||
54 | */ |
||
55 | public function getBlue() { |
||
58 | |||
59 | /** |
||
60 | * @return array |
||
61 | */ |
||
62 | public function asArray() { |
||
65 | |||
66 | |||
67 | public static function RANDOM() { |
||
70 | |||
71 | public static function BLUE() { |
||
74 | |||
75 | public static function GREEN() { |
||
78 | |||
79 | public static function RED() { |
||
82 | |||
83 | public static function PURPLE() { |
||
86 | |||
87 | public static function ORANGE() { |
||
90 | |||
91 | public static function BROWN() { |
||
94 | |||
95 | public static function PINK() { |
||
98 | |||
99 | public static function YELLOW() { |
||
102 | |||
103 | public static function GRAY() { |
||
106 | } |