Issue #3084955 by kiamlaluno, mcdruid, Taran2L: Invalid characters passed for attempted conversion, these have been ignored in _color_unpack()
parent
b20c7a939a
commit
398945d6db
|
@ -734,8 +734,9 @@ function _color_blend($img, $hex1, $hex2, $alpha) {
|
|||
* Converts a hex color into an RGB triplet.
|
||||
*/
|
||||
function _color_unpack($hex, $normalize = FALSE) {
|
||||
if (strlen($hex) == 4) {
|
||||
$hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
|
||||
$hex = substr($hex, 1);
|
||||
if (strlen($hex) == 3) {
|
||||
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
|
||||
}
|
||||
$c = hexdec($hex);
|
||||
for ($i = 16; $i >= 0; $i -= 8) {
|
||||
|
|
Loading…
Reference in New Issue