Commit c804f144 authored by catch's avatar catch
Browse files

Issue #3240176 by alexpott, andypost: _color_pack() can cause deprecations on PHP 8.1

parent 9005e1b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -775,7 +775,7 @@ function _color_unpack($hex, $normalize = FALSE) {
function _color_pack($rgb, $normalize = FALSE) {
  $out = 0;
  foreach ($rgb as $k => $v) {
    $out |= (($v * ($normalize ? 255 : 1)) << (16 - $k * 8));
    $out |= ((int) ($v * ($normalize ? 255 : 1)) << (16 - $k * 8));
  }

  return '#' . str_pad(dechex($out), 6, 0, STR_PAD_LEFT);