File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ public function render(OutputFormat $outputFormat): string
227
227
// Shorthand RGB color values
228
228
if (
229
229
$ outputFormat ->getRGBHashNotation ()
230
- && \implode ( '' , \array_keys ( $ this ->aComponents ) ) === 'rgb '
230
+ && $ this ->getRealName ( ) === 'rgb '
231
231
&& $ this ->allComponentsAreNumbers ()
232
232
) {
233
233
$ result = \sprintf (
@@ -242,6 +242,16 @@ public function render(OutputFormat $outputFormat): string
242
242
return parent ::render ($ outputFormat );
243
243
}
244
244
245
+ /**
246
+ * The function name is a concatenation of the array keys of the components, which is passed to the constructor.
247
+ * However, this can be changed by calling {@see CSSFunction::setName},
248
+ * so is not reliable in situations where it's necessary to determine the function name based on the components.
249
+ */
250
+ private function getRealName (): string
251
+ {
252
+ return \implode ('' , \array_keys ($ this ->aComponents ));
253
+ }
254
+
245
255
/**
246
256
* Test whether all color components are absolute numbers (CSS type `number`), not percentages or anything else.
247
257
* If any component is not an instance of `Size`, the method will also return `false`.
You can’t perform that action at this time.
0 commit comments