From 5f5cc9ed8d62ac10b4daa5dd839a93e46ec5f0eb Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 2 Dec 2023 12:37:13 +0100 Subject: [PATCH] Improve method --- src/Colors/AbstractColorChannel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Colors/AbstractColorChannel.php b/src/Colors/AbstractColorChannel.php index a5777714..a2d0db7b 100644 --- a/src/Colors/AbstractColorChannel.php +++ b/src/Colors/AbstractColorChannel.php @@ -52,7 +52,7 @@ abstract class AbstractColorChannel implements ColorChannelInterface */ public function normalize($precision = 32): float { - return round($this->value() / $this->max(), $precision); + return round(($this->value() - $this->min()) / ($this->max() - $this->min()), $precision); } /**