Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class CSSOpacityChannel extends ColorChannel |
||
11 | { |
||
12 | /** |
||
13 | * @var float |
||
14 | */ |
||
15 | private $value; |
||
16 | |||
17 | public function __construct(float $value) |
||
18 | { |
||
19 | $this->value = $value; |
||
20 | } |
||
21 | |||
22 | public function getFloat() : float |
||
23 | { |
||
24 | return $this->value; |
||
25 | } |
||
26 | |||
27 | public function get8Bit() : int |
||
28 | { |
||
29 | return UnitsConverter::float2IntEightBit($this->value); |
||
30 | } |
||
31 | |||
32 | public function get7Bit() : int |
||
33 | { |
||
34 | return UnitsConverter::float2IntSevenBit($this->value); |
||
35 | } |
||
36 | |||
37 | public function getPercent() : float |
||
38 | { |
||
39 | return UnitsConverter::float2percent($this->value); |
||
40 | } |
||
41 | |||
42 | public function invert() : CSSOpacityChannel |
||
45 | } |
||
46 | } |
||
47 |