1 | <?php |
||
7 | class main implements \Serializable, \JsonSerializable { |
||
8 | |||
9 | public $color; |
||
10 | |||
11 | public function __construct($color) { |
||
14 | |||
15 | public function __clone() { |
||
20 | |||
21 | public function serialize() :string { |
||
24 | |||
25 | public function unserialize($serialized) { |
||
30 | |||
31 | public function jsonSerialize() :array { |
||
34 | |||
35 | |||
36 | protected function set($color, string $type = '') { |
||
43 | |||
44 | public function rgb() :array { |
||
47 | |||
48 | public function hsl(int $accuracy = 0) :array { |
||
55 | |||
56 | public function cmyk() :array { |
||
60 | |||
61 | public function hex() :string { |
||
64 | |||
65 | public function css() :string { |
||
68 | |||
69 | /** |
||
70 | * Get (and set) the alpha channel |
||
71 | * |
||
72 | * @param mixed $new_alpha If numeric, the alpha channel is set to this value |
||
73 | * @return float The current alpha value |
||
74 | */ |
||
75 | public function alpha($new_alpha) { |
||
78 | |||
79 | public function is_dark(int $check_score = 128) :bool { |
||
83 | |||
84 | public function red(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
87 | |||
88 | public function green(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
91 | |||
92 | public function blue(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
95 | |||
96 | public function hue(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
99 | |||
100 | public function saturation(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
103 | |||
104 | public function light(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
107 | |||
108 | public function rgb_scheme(string $scheme_name) :array { |
||
111 | |||
112 | public function hsl_scheme(string $scheme_name) :array { |
||
115 | |||
116 | public function hex_scheme(string $scheme_name) :array { |
||
119 | |||
120 | public function cmyk_scheme(string $scheme_name) :array { |
||
123 | |||
124 | protected static function _scheme(string $scheme_name, string $callback, array $hsl) { |
||
136 | |||
137 | |||
138 | } |
||
139 |