Same name in other branches
- 8.x-2.x src/ColorHSL.php \Drupal\color_field\ColorHSL::toString()
A string representation of this color in the current format.
Paramètres
bool $opacity: Whether to display the opacity.
Return value
string The color as hsla(#, #, #, #) or hsl(#, #, #) if opacity is false.
Overrides ColorInterface::toString
Fichier
-
src/
ColorHSL.php, line 105
Classe
- ColorHSL
- RGB represents the RGB color format.
Namespace
Drupal\color_fieldCode
public function toString(bool $opacity = TRUE) : string {
$output = $opacity ? 'hsla(' . $this->hue . ',' . $this->sat . ',' . $this->lum . ',' . $this->getOpacity() . ')' : 'hsl(' . $this->hue . ',' . $this->sat . ',' . $this->lum . ')';
return strtolower($output);
}