Same name in other branches
- 8.x-2.x src/ColorCMY.php \Drupal\color_field\ColorCMY::toRgb()
Overrides ColorInterface::toRgb
1 method overrides ColorCMY::toRgb()
- ColorCMYK::toRgb dans src/
ColorCMYK.php - Get the color as an RGB instance.
Fichier
-
src/
ColorCMY.php, line 105
Classe
- ColorCMY
- ColorCMY represents the CMY color format.
Namespace
Drupal\color_fieldCode
public function toRgb() : ColorRGB {
$red = (1 - $this->cyan) * 255;
$green = (1 - $this->magenta) * 255;
$blue = (1 - $this->yellow) * 255;
return new ColorRGB($red, $green, $blue, $this->getOpacity());
}