public function setFromValue($rgb, $hasalpha = true)
    {
        $r = ($rgb >> 16) & 0xFF;
        $g = ($rgb >> 8) & 0xFF;
        $b = ($rgb >> 0) & 0xFF;
        if ($hasalpha) {
            $a = ($rgb >> 24) & 0xff;

            return $this->setRed($r)
                            ->setGreen($g)
                            ->setBlue($b)
                            ->setAlpha($a);
        }

        return $this->setRed($r)
                        ->setGreen($g)
                        ->setBlue($b);
    }
public function setFromValue($rgb, $hasalpha = true)
    {
        $r = ($rgb >> 16) & 0xFF;
        $g = ($rgb >> 8) & 0xFF;
        $b = ($rgb >> 0) & 0xFF;
        if ($hasalpha) {
            $a = ($rgb >> 24) & 0xff;

            return $this->setRed($r)
                            ->setGreen($g)
                            ->setBlue($b)
                            ->setAlpha($a);
        }

        return $this->setRed($r)
                        ->setGreen($g)
                        ->setBlue($b);
    }
public function setFromValue ( $ rgb , $ hasalpha = true ) { $ r = ( $ rgb >> 16 ) & 0xFF ; $ g = ( $ rgb >> 8 ) & 0xFF ; $ b = ( $ rgb >> 0 ) & 0xFF ; if ( $ hasalpha ) { $ a = ( $ rgb >> 24 ) & 0xff ; return $ this -> setRed ( $ r ) -> setGreen ( $ g ) -> setBlue ( $ b ) -> setAlpha ( $ a ) ; } return $ this -> setRed ( $ r ) -> setGreen ( $ g ) -> setBlue ( $ b ) ; }
Set color from rgb integer

@param integer $rgb
@param boolean $hasalpha true if the rgb contains the alpha and false if not

@return \Jaguar\Color\RGBColor
Set color from rgb integer