mirror of
https://github.com/Intervention/image.git
synced 2025-08-13 17:34:04 +02:00
Merge pull request #685 from agence-webup/master
Fix rgba string with non-localized number
This commit is contained in:
@@ -177,7 +177,7 @@ class Color extends AbstractColor
|
|||||||
*/
|
*/
|
||||||
public function getRgba()
|
public function getRgba()
|
||||||
{
|
{
|
||||||
return sprintf('rgba(%d, %d, %d, %.2f)', $this->r, $this->g, $this->b, round(1 - $this->a / 127, 2));
|
return sprintf('rgba(%d, %d, %d, %.2F)', $this->r, $this->g, $this->b, round(1 - $this->a / 127, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -18,7 +18,7 @@ class OpacityCommand extends \Intervention\Image\Commands\AbstractCommand
|
|||||||
$size = $image->getSize();
|
$size = $image->getSize();
|
||||||
|
|
||||||
// build temp alpha mask
|
// build temp alpha mask
|
||||||
$mask_color = sprintf('rgba(0, 0, 0, %.1f)', $transparency / 100);
|
$mask_color = sprintf('rgba(0, 0, 0, %.1F)', $transparency / 100);
|
||||||
$mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color);
|
$mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color);
|
||||||
|
|
||||||
// mask image
|
// mask image
|
||||||
|
@@ -163,7 +163,7 @@ class Color extends \Intervention\Image\AbstractColor
|
|||||||
*/
|
*/
|
||||||
public function getRgba()
|
public function getRgba()
|
||||||
{
|
{
|
||||||
return sprintf('rgba(%d, %d, %d, %.2f)',
|
return sprintf('rgba(%d, %d, %d, %.2F)',
|
||||||
$this->getRedValue(),
|
$this->getRedValue(),
|
||||||
$this->getGreenValue(),
|
$this->getGreenValue(),
|
||||||
$this->getBlueValue(),
|
$this->getBlueValue(),
|
||||||
@@ -248,7 +248,7 @@ class Color extends \Intervention\Image\AbstractColor
|
|||||||
$a = is_null($a) ? 1 : $a;
|
$a = is_null($a) ? 1 : $a;
|
||||||
|
|
||||||
return $this->pixel = new \ImagickPixel(
|
return $this->pixel = new \ImagickPixel(
|
||||||
sprintf('rgba(%d, %d, %d, %.2f)', $r, $g, $b, $a)
|
sprintf('rgba(%d, %d, %d, %.2F)', $r, $g, $b, $a)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user