diff --git a/src/Transformer/Utilities/CyanMagentaYellowKeyToHueSaturationValue.php b/src/Transformer/Utilities/CyanMagentaYellowKeyToHueSaturationValue.php index 12ed5e2..4613f75 100644 --- a/src/Transformer/Utilities/CyanMagentaYellowKeyToHueSaturationValue.php +++ b/src/Transformer/Utilities/CyanMagentaYellowKeyToHueSaturationValue.php @@ -55,6 +55,9 @@ class CyanMagentaYellowKeyToHueSaturationValue $this->minCmyProperty = min($this->cyan, $this->magenta, $this->yellow); $this->hue = $this->buildHueAmount(); + if ($this->hue === 1.0) { + $this->hue = 0.0; + } $this->saturation = $this->maxCmyProperty; $this->value = 1 - $this->key; } @@ -71,7 +74,7 @@ class CyanMagentaYellowKeyToHueSaturationValue protected function buildHueAmount(): float { - if ($this->maxCmyProperty === 0) { + if ($this->maxCmyProperty === 0.0) { return 0.0; } @@ -88,10 +91,6 @@ class CyanMagentaYellowKeyToHueSaturationValue */ private function hueAmount(string $property): float { - if ($this->maxCmyProperty === 0.0) { - return 0.0; - } - static $amount_share = 2.0; $divisor = $this->maxCmyProperty - $this->minCmyProperty;