@@ -83,10 +83,10 @@ public function __construct($mColor=null) {
83
83
}
84
84
}
85
85
else if (is_string ($ mColor )) {
86
- if ($ aRGB = ColorUtils ::namedColor2rgb ($ mColor )) {
86
+ if ($ aRGB = CSSColorUtils ::namedColor2rgb ($ mColor )) {
87
87
$ this ->fromRGB ($ aRGB );
88
88
}
89
- else if ($ aRGB = ColorUtils ::hex2rgb ($ mColor )) {
89
+ else if ($ aRGB = CSSColorUtils ::hex2rgb ($ mColor )) {
90
90
$ this ->fromRGB ($ aRGB );
91
91
}
92
92
}
@@ -98,12 +98,12 @@ public function fromRGB(Array $aRGB) {
98
98
foreach (array ('r ' , 'g ' , 'b ' , 'a ' ) as $ sChannel ) {
99
99
if ($ sChannel == 'a ' ) {
100
100
if (!isset ($ aRGB ['a ' ])) continue ;
101
- $ sValue = ColorUtils ::constrainValue ((string )$ aRGB ['a ' ], 0 , 1 );
101
+ $ sValue = CSSColorUtils ::constrainValue ((string )$ aRGB ['a ' ], 0 , 1 );
102
102
if ($ sValue == 1 ) continue ;
103
103
$ sName .= 'a ' ;
104
104
}
105
105
else {
106
- $ sValue = ColorUtils ::normalizeRGBValue ((string )$ aRGB [$ sChannel ]);
106
+ $ sValue = CSSColorUtils ::normalizeRGBValue ((string )$ aRGB [$ sChannel ]);
107
107
}
108
108
$ this ->aComponents [$ sChannel ] = new CSSSize ($ sValue , null , true );
109
109
}
@@ -112,7 +112,7 @@ public function fromRGB(Array $aRGB) {
112
112
}
113
113
114
114
public function fromHSL (Array $ aHSL ) {
115
- $ aRGB = ColorUtils ::hsl2rgb (
115
+ $ aRGB = CSSColorUtils ::hsl2rgb (
116
116
(string )$ aHSL ['h ' ],
117
117
(string )$ aHSL ['s ' ],
118
118
(string )$ aHSL ['l ' ],
@@ -122,12 +122,12 @@ public function fromHSL(Array $aHSL) {
122
122
}
123
123
124
124
public function fromHex ($ sValue ) {
125
- $ aRGB = ColorUtils ::hex2rgb ($ sValue );
125
+ $ aRGB = CSSColorUtils ::hex2rgb ($ sValue );
126
126
return $ this ->fromRGB ($ aRGB );
127
127
}
128
128
129
129
public function fromNamedColor ($ sValue ) {
130
- $ aRGB = ColorUtils ::namedColor2rgb ($ sValue );
130
+ $ aRGB = CSSColorUtils ::namedColor2rgb ($ sValue );
131
131
return $ this ->fromRGB ($ aRGB );
132
132
}
133
133
@@ -157,7 +157,7 @@ public function toRGB() {
157
157
}
158
158
return ;
159
159
}
160
- $ aRGB = ColorUtils ::hsl2rgb (
160
+ $ aRGB = CSSColorUtils ::hsl2rgb (
161
161
$ aComponents ['h ' ]->getSize (),
162
162
$ aComponents ['s ' ]->getSize (),
163
163
$ aComponents ['l ' ]->getSize (),
@@ -185,7 +185,7 @@ public function toHSL() {
185
185
}
186
186
return ;
187
187
}
188
- $ aHSL = ColorUtils ::rgb2hsl (
188
+ $ aHSL = CSSColorUtils ::rgb2hsl (
189
189
$ aComponents ['r ' ]->getSize (),
190
190
$ aComponents ['g ' ]->getSize (),
191
191
$ aComponents ['b ' ]->getSize (),
@@ -207,7 +207,7 @@ public function toHSL() {
207
207
public function getNamedColor () {
208
208
$ this ->toRGB ();
209
209
$ aComponents = $ this ->aComponents ;
210
- return ColorUtils ::rgb2NamedColor (
210
+ return CSSColorUtils ::rgb2NamedColor (
211
211
$ aComponents ['r ' ]->getSize (),
212
212
$ aComponents ['g ' ]->getSize (),
213
213
$ aComponents ['b ' ]->getSize ()
@@ -219,14 +219,14 @@ public function getHexValue() {
219
219
if (isset ($ aComponents ['a ' ]) && $ aComponents ['a ' ]->getSize () !== 1 ) return null ;
220
220
$ sName = $ this ->getName ();
221
221
if ($ sName == 'rgb ' ) {
222
- return ColorUtils ::rgb2hex (
222
+ return CSSColorUtils ::rgb2hex (
223
223
$ aComponents ['r ' ]->getSize (),
224
224
$ aComponents ['g ' ]->getSize (),
225
225
$ aComponents ['b ' ]->getSize ()
226
226
);
227
227
}
228
228
else if ($ sName == 'hsl ' ) {
229
- return ColorUtils ::hsl2hex (
229
+ return CSSColorUtils ::hsl2hex (
230
230
$ aComponents ['h ' ]->getSize (),
231
231
$ aComponents ['s ' ]->getSize (),
232
232
$ aComponents ['l ' ]->getSize ()
0 commit comments