I've looked at this code a number of times already but I still don't really get it:
PHP Code:
 * Convert an RGB triplet to a hex color.
function _color_pack($rgb$normalize false) {
  foreach (
$rgb as $k => $v) {
$out |= (($v * ($normalize 255 1)) << (16 $k 8));
'#'str_pad(dechex($out), 60STR_PAD_LEFT);

What I don't get is what the third line is doing, beginning with the |= part that means bitshift I think but Im not sure.
Can anyone explain what steps this code takes logically to turn an RGB triplet into a hex code?