Skip to content

Commit 877e2f7

Browse files
committed
Merge pull request #9 from FinesseRus/master
Fix: comma in css floats
2 parents 43c5b84 + 890c41c commit 877e2f7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/Primal/Color/CMYKColor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function toRGB() {
6060
public function toCSS($alpha = null) {
6161
return ($alpha === true || $this->alpha < 1) && $alpha !== false
6262
? sprintf('device-cmyk(%d%%, %d%%, %d%%, %d%%, %s)',
63-
$this->cyan, $this->magenta, $this->yellow, $this->black, $this->alpha)
63+
$this->cyan, $this->magenta, $this->yellow, $this->black, number_format($this->alpha, 2, '.', ''))
6464
: sprintf('device-cmyk(%d%%, %d%%, %d%%, %d%%)',
6565
$this->cyan, $this->magenta, $this->yellow, $this->black);
6666
}

lib/Primal/Color/HSLColor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected static function HueToFactor($p, $q, $t) {
7272
*/
7373
public function toCSS($alpha = null) {
7474
return ($alpha === true || $this->alpha < 1) && $alpha !== false
75-
? sprintf('hsla(%d, %d, %d, %s)', $this->hue, $this->saturation, $this->luminance, $this->alpha)
75+
? sprintf('hsla(%d, %d, %d, %s)', $this->hue, $this->saturation, $this->luminance, number_format($this->alpha, 2, '.', ''))
7676
: sprintf('hsl(%d, %d, %d)', $this->hue, $this->saturation, $this->luminance);
7777
}
7878
}

lib/Primal/Color/RGBColor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function toRGB() {
116116
*/
117117
public function toCSS($alpha = null) {
118118
return ($alpha === true || $this->alpha < 1) && $alpha !== false
119-
? sprintf('rgba(%d, %d, %d, %s)', $this->red, $this->green, $this->blue, $this->alpha)
119+
? sprintf('rgba(%d, %d, %d, %s)', $this->red, $this->green, $this->blue, number_format($this->alpha, 2, '.', ''))
120120
: sprintf('rgb(%d, %d, %d)', $this->red, $this->green, $this->blue);
121121
}
122122

0 commit comments

Comments
 (0)