public function effect($effect)
    {
        $args = array_slice(func_get_args(), 1);

        if($effect instanceof PictureEffect)
        {
            $this->effect[] = $effect;
        }
        else
        {
            $effectClass = "Palette\\Effect\\" . $effect;

            if(class_exists($effectClass))
            {
                $reflection = new ReflectionClass($effectClass);
                $this->effect[] = $reflection->newInstanceArgs($args);
            }
            else
            {
                throw new Exception('Unknown Palette effect instance');
            }
        }
    }
public function effect($effect)
    {
        $args = array_slice(func_get_args(), 1);

        if($effect instanceof PictureEffect)
        {
            $this->effect[] = $effect;
        }
        else
        {
            $effectClass = "Palette\\Effect\\" . $effect;

            if(class_exists($effectClass))
            {
                $reflection = new ReflectionClass($effectClass);
                $this->effect[] = $reflection->newInstanceArgs($args);
            }
            else
            {
                throw new Exception('Unknown Palette effect instance');
            }
        }
    }
public function effect ( $ effect ) { $ args = array_slice ( func_get_args ( ) , 1 ) ; if ( $ effect instanceof PictureEffect ) { $ this -> effect [ ] = $ effect ; } else { $ effectClass = "Palette\\Effect\\" . $ effect ; if ( class_exists ( $ effectClass ) ) { $ reflection = new ReflectionClass ( $ effectClass ) ; $ this -> effect [ ] = $ reflection -> newInstanceArgs ( $ args ) ; } else { throw new Exception ( 'Unknown Palette effect instance' ) ; } } }
Add new picture effect
@param $effect
@throws Exception
Add new picture effect