You are here

public function ColorCMYK::toCmy in Color Field 8.2

File

src/ColorCMYK.php, line 130

Class

ColorCMYK
ColorCMYK represents the CMYK color format.

Namespace

Drupal\color_field

Code

public function toCmy() {
  $cyan = $this->cyan * (1 - $this->key) + $this->key;
  $magenta = $this->magenta * (1 - $this->key) + $this->key;
  $yellow = $this->yellow * (1 - $this->key) + $this->key;
  return new ColorCMY($cyan, $magenta, $yellow, $this
    ->getOpacity());
}