0 && !isset($lookup[$value])) { if (!$hasAlphaChannel && ($value & 0xff) < 255) { $hasAlphaChannel = true; } $lookup[$value] = $colorsCount++; $colors[] = $value; if ($colorsCount > 256) { break; } } $count = -1; } } $this->hasAlphaChannel = $hasAlphaChannel; $this->colors = & $colors; $this->lookup = & $lookup; $this->isValid = $colorsCount <= 256; } /** * Specifies if the palette is valid to be used for encoding a PNG image. * * @var boolean */ public $isValid; /** * Specifies if the palette has any partial or fully transparent * colors. * * @var boolean */ public $hasAlphaChannel; /** * Array of colors in the palette. * * @var array */ public $colors; /** * Lookup table from 32-bit color value to color index. * * @var array */ public $lookup; }