> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $line .= sprintf("%02X%02X%02X",min(max($r,0),255),min(max($g,0),255),min(max($b,0),255)); // Increate the line length counter; check if stream line needs to be terminated $ctr += 6; if ($ctr > MAX_LINE_LENGTH) { $line .= "\n"; $ctr = 0; } }; $lines[] = $line; }; return $lines; } } ?>