src/DataDefinition/Palette/Builder/PaletteBuilder.php
public function createPalette($name = null)
    {
        if ($this->palette) {
            $this->finishPalette();
        }

        $palette = $this->paletteClass->newInstance();

        if ($name) {
            $palette->setName($name);
        }

        $event = new CreatePaletteEvent($palette, $this);
        $this->dispatchEvent($event);
        $this->palette = $event->getPalette();

        return $this;
    }
public function createPalette($name = null)
    {
        if ($this->palette) {
            $this->finishPalette();
        }

        $palette = $this->paletteClass->newInstance();

        if ($name) {
            $palette->setName($name);
        }

        $event = new CreatePaletteEvent($palette, $this);
        $this->dispatchEvent($event);
        $this->palette = $event->getPalette();

        return $this;
    }
public function createPalette ( $ name = null ) { if ( $ this -> palette ) { $ this -> finishPalette ( ) ; } $ palette = $ this -> paletteClass -> newInstance ( ) ; if ( $ name ) { $ palette -> setName ( $ name ) ; } $ event = new CreatePaletteEvent ( $ palette , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> palette = $ event -> getPalette ( ) ; return $ this ; }
Start a new palette.

@param string|null $name Only for backwards compatibility, We will remove palette names in the future
(deprecated).

@return PaletteBuilder
Start a new palette .