You are here

public function SassColour::getLightness in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/literals/SassColour.php \SassColour::getLightness()

* Returns the lightness of this colour. *

Return value

float the lightness of this colour.

3 calls to SassColour::getLightness()
SassColour::getHsl in phamlp/sass/script/literals/SassColour.php
* Returns an array with the HSL components of this colour. *
SassColour::getHsla in phamlp/sass/script/literals/SassColour.php
* Returns an array with the HSL and alpha components of this colour. *
SassColour::with in phamlp/sass/script/literals/SassColour.php
* Returns a copy of this colour with one or more channels changed. * RGB or HSL attributes may be changed, but not both at once. *

File

phamlp/sass/script/literals/SassColour.php, line 645

Class

SassColour
SassColour class. A SassScript object representing a CSS colour.

Code

public function getLightness() {
  if (is_null($this->lightness)) {
    $this
      ->rgb2hsl();
  }
  return $this->lightness;
}