You are here

public function ColorCMY::toCmy in Color Field 8.2

File

src/ColorCMY.php, line 113

Class

ColorCMY
ColorCMY represents the CMY 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);
}