BxDolImageResize::getAverageColor PHP Method

getAverageColor() public method

public getAverageColor ( $sSrcImage )
    function getAverageColor($sSrcImage)
    {
        $this->_sError = '';
        try {
            $a = $this->_oManager->make($sSrcImage)->resize(1, 1)->pickColor(0, 0, 'array');
            return array('r' => $a[0], 'g' => $a[1], 'b' => $a[2]);
        } catch (Exception $e) {
            $this->_sError = $e->getMessage();
            return false;
        }
    }