getRed() public method

Returns the red component of this colour.
public getRed ( boolean $value = false ) : integer
$value boolean
return integer the red component of this colour.
Beispiel #1
0
 /**
  * Returns a copy of this colour with one or more channels changed.
  * RGB or HSL attributes may be changed, but not both at once.
  * @param array attributes to change
  */
 public function with($attributes)
 {
     if ($this->assertValid($attributes, false) === 'hsl') {
         $colour = array_merge(array('hue' => $this->getHue(), 'saturation' => $this->getSaturation(), 'lightness' => $this->getLightness(), 'alpha' => $this->alpha), $attributes);
     } else {
         $colour = array_merge(array('red' => $this->getRed(), 'green' => $this->getGreen(), 'blue' => $this->getBlue(), 'alpha' => $this->alpha), $attributes);
     }
     $colour = new SassColour($colour);
     $colour->getRed();
     # will get RGB and HSL
     return $colour;
 }