1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-30 01:00:06 +02:00
This commit is contained in:
Oliver Vogel
2013-03-22 15:52:58 +01:00
parent ca3a41f5a3
commit 827c542017

View File

@@ -1135,10 +1135,17 @@ class Image
} elseif(is_array($value)) {
// parse color array like: array(155, 155, 155)
list($r, $g, $b, $a) = $value;
if (count($value) == 4) {
// set alpha if available (A value between 0 [opaque] and 127 [transparent])
$alpha = is_numeric($a) ? intval($a) : $alpha;
// color array with alpha value
list($r, $g, $b, $alpha) = $value;
} elseif (count($value) == 3) {
// color array without alpha value
list($r, $g, $b) = $value;
}
} elseif(is_string($value)) {