protected function setOptions($options)
    {
        $options = array_merge(array(
            'format'                => 'hex',
            'invoke_inline'         => false,
            'include_dependencies'  => false,
            'as_component'          => false,
            'class'                 => 'colorpicker',
        ), $options);

        if (!in_array($options['format'], array('hex', 'rgb', 'rgba'))) {
            throw new Exception\InvalidArgumentException(
                'Invalid format supplied. Allowed formats are "hex", "rgb" and "rgba".'
            );
        }

        $defaultColors = array(
            'hex'   => '#fff',
            'rgb'   => 'rgb(255,255,255)',
            'rgba'  => 'rgba(255,255,255,1)',
        );

        if (empty($options['color'])) {
            $options['color'] = $defaultColors[$options['format']];
        }

        return $this->options = $options;
    }
protected function setOptions($options)
    {
        $options = array_merge(array(
            'format'                => 'hex',
            'invoke_inline'         => false,
            'include_dependencies'  => false,
            'as_component'          => false,
            'class'                 => 'colorpicker',
        ), $options);

        if (!in_array($options['format'], array('hex', 'rgb', 'rgba'))) {
            throw new Exception\InvalidArgumentException(
                'Invalid format supplied. Allowed formats are "hex", "rgb" and "rgba".'
            );
        }

        $defaultColors = array(
            'hex'   => '#fff',
            'rgb'   => 'rgb(255,255,255)',
            'rgba'  => 'rgba(255,255,255,1)',
        );

        if (empty($options['color'])) {
            $options['color'] = $defaultColors[$options['format']];
        }

        return $this->options = $options;
    }
protected function setOptions ( $ options ) { $ options = array_merge ( array ( 'format' => 'hex' , 'invoke_inline' => false , 'include_dependencies' => false , 'as_component' => false , 'class' => 'colorpicker' , ) , $ options ) ; if ( ! in_array ( $ options [ 'format' ] , array ( 'hex' , 'rgb' , 'rgba' ) ) ) { throw new Exception \ InvalidArgumentException ( 'Invalid format supplied. Allowed formats are "hex", "rgb" and "rgba".' ) ; } $ defaultColors = array ( 'hex' => '#fff' , 'rgb' => 'rgb(255,255,255)' , 'rgba' => 'rgba(255,255,255,1)' , ) ; if ( empty ( $ options [ 'color' ] ) ) { $ options [ 'color' ] = $ defaultColors [ $ options [ 'format' ] ] ; } return $ this -> options = $ options ; }
Set the options for the colorpicker.

@param    array   $options
@return   array   The options.
@throws   Exception\InvalidArgumentException
Set the options for the colorpicker .