From 615cb0f655fae18e9b79d6411a9f90e849ea024d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20L=C3=BCcke?= Date: Thu, 11 Mar 2021 15:04:38 +0100 Subject: [PATCH] Festlegung der Angabe des Farbkreises bei einem Vollkreis. Der Wert soll '0,0' lauten. --- .../CyanMagentaYellowKeyToHueSaturationValue.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;