public function writePalette(PngPalette $palette) 
    {
        if ($palette && $palette->isValid) {
            $this->buffer->startChunk("PLTE");

            foreach ($palette->colors as $color) {
                $this->buffer->writeString(
                    pack('C', ($color >> 24) & 0xff) .
                    pack('C', ($color >> 16) & 0xff) .
                    pack('C', ($color >> 8) & 0xff));
            }

            $this->buffer->endChunk();
        }
    }
public function writePalette(PngPalette $palette) 
    {
        if ($palette && $palette->isValid) {
            $this->buffer->startChunk("PLTE");

            foreach ($palette->colors as $color) {
                $this->buffer->writeString(
                    pack('C', ($color >> 24) & 0xff) .
                    pack('C', ($color >> 16) & 0xff) .
                    pack('C', ($color >> 8) & 0xff));
            }

            $this->buffer->endChunk();
        }
    }
public function writePalette ( PngPalette $ palette ) { if ( $ palette && $ palette -> isValid ) { $ this -> buffer -> startChunk ( "PLTE" ) ; foreach ( $ palette -> colors as $ color ) { $ this -> buffer -> writeString ( pack ( 'C' , ( $ color >> 24 ) & 0xff ) . pack ( 'C' , ( $ color >> 16 ) & 0xff ) . pack ( 'C' , ( $ color >> 8 ) & 0xff ) ) ; } $ this -> buffer -> endChunk ( ) ; } }
Writes a PLTE chunk containing the indexed colors.

@param \Jdenticon\Canvas\Png\PngPalette $palette Palette containing the
indexed colors.
Writes a PLTE chunk containing the indexed colors .