1 | <?php |
||
7 | class main implements \Serializable { |
||
8 | |||
9 | public $color; |
||
10 | public $hsl_result_accuracy = 0; |
||
11 | |||
12 | public function __construct($color) { |
||
15 | |||
16 | public function __clone() { |
||
21 | |||
22 | public function serialize() :string { |
||
25 | |||
26 | public function unserialize($serialized) { |
||
31 | |||
32 | public function set($color, string $type = '') { |
||
39 | |||
40 | public function rgb() :array { |
||
43 | |||
44 | public function hsl() :array { |
||
51 | |||
52 | public function cmyk() :array { |
||
56 | |||
57 | public function hex() :string { |
||
60 | |||
61 | public function css() :string { |
||
64 | |||
65 | /** |
||
66 | * Get (and set) the alpha channel |
||
67 | * |
||
68 | * @param mixed $new_alpha If numeric, the alpha channel is set to this value |
||
69 | * @return float The current alpha value |
||
70 | */ |
||
71 | public function alpha($new_alpha) { |
||
74 | |||
75 | public function is_dark(int $check_score = 128) :bool { |
||
79 | |||
80 | public function red(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
83 | |||
84 | public function green(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
87 | |||
88 | public function blue(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
91 | |||
92 | public function hue(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
95 | |||
96 | public function saturation(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
99 | |||
100 | public function light(float $adjustment, bool $as_percentage = FALSE, bool $set_absolute = TRUE) { |
||
103 | |||
104 | public function rgb_scheme(string $scheme_name = '') :array { |
||
110 | |||
111 | public function hsl_scheme(string $scheme_name = '') :array { |
||
124 | |||
125 | public function hex_scheme(string $scheme_name = '') :array { |
||
131 | |||
132 | public function cmyk_scheme(string $scheme_name = '') :array { |
||
138 | |||
139 | protected static function _convert_scheme(array $scheme, callable $callback) { |
||
146 | } |
||
147 |