1 | <?php |
||
11 | class css { |
||
12 | |||
13 | /** |
||
14 | * Force alpha value to be present where possible. |
||
15 | * @var boolean |
||
16 | */ |
||
17 | public static $force_alpha = FALSE; |
||
18 | |||
19 | public static function get(string $input, $support_x11 = TRUE) { |
||
27 | 1 | ||
28 | 1 | protected static function format_matches(array $matches) { |
|
40 | 1 | ||
41 | 1 | /** |
|
42 | 1 | * Choose the best way to represent the color as a CSS value. Will use either |
|
43 | * a hex or rgba value depending on the alpha value. |
||
44 | 1 | * |
|
45 | * @param mixed $color The color |
||
46 | * @return string The CSS value |
||
47 | */ |
||
48 | public static function best($color) { |
||
55 | 1 | ||
56 | /** |
||
57 | * Force $color to be an instance of color |
||
58 | * |
||
59 | * @param mixed &$color The color |
||
60 | * @return void |
||
61 | */ |
||
62 | protected static function _color_instance(&$color) { |
||
67 | |||
68 | /** |
||
69 | * Convert and RGB value to a CSS hex string |
||
70 | * |
||
71 | * @param float $r The red value |
||
72 | * @param float $g The green value |
||
73 | * @param float $b The blue value |
||
74 | * @return string The CSS string |
||
75 | */ |
||
76 | public static function hex(float $r, float $g, float $b) { |
||
79 | |||
80 | /** |
||
81 | * Convert and RGB value to a CSS rgb or rgba string |
||
82 | * |
||
83 | * @param float $r The red value |
||
84 | * @param float $g The green value |
||
85 | * @param float $b The blue value |
||
86 | * @return string The CSS string |
||
87 | */ |
||
88 | public static function rgb(float $r, float $g, float $b, float $a = 1.0) { |
||
94 | |||
95 | /** |
||
96 | * Convert and HSL value to a CSS hsl or hsla string |
||
97 | * |
||
98 | * @param float $h The hue value |
||
99 | * @param float $s The saturation value |
||
100 | * @param float $l The light value |
||
101 | * @return string The CSS string |
||
102 | */ |
||
103 | public static function hsl(float $h, float $s, float $l, float $a = 1.0) { |
||
109 | } |
||
110 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.