1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-27 07:44:30 +02:00
This commit is contained in:
Oliver Vogel
2013-04-14 13:18:01 +02:00
parent 08c3ec7c6d
commit 9fd9e8777d

View File

@@ -1313,7 +1313,7 @@ class Image
$b = ($matches[3] >= 0 && $matches[3] <= 255) ? intval($matches[3]) : 0; $b = ($matches[3] >= 0 && $matches[3] <= 255) ? intval($matches[3]) : 0;
// parse color string in format rgba(255, 0, 0, 0.5) // parse color string in format rgba(255, 0, 0, 0.5)
} elseif (preg_match('/^rgba ?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9.]{1,3})\)$/i', $value, $matches)) { } elseif (preg_match('/^rgba ?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9.]{1,4})\)$/i', $value, $matches)) {
$r = ($matches[1] >= 0 && $matches[1] <= 255) ? intval($matches[1]) : 0; $r = ($matches[1] >= 0 && $matches[1] <= 255) ? intval($matches[1]) : 0;
$g = ($matches[2] >= 0 && $matches[2] <= 255) ? intval($matches[2]) : 0; $g = ($matches[2] >= 0 && $matches[2] <= 255) ? intval($matches[2]) : 0;