1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-22 21:42:53 +02:00

Improve method

This commit is contained in:
Oliver Vogel
2023-12-02 12:37:13 +01:00
parent 30ab6a6c54
commit 5f5cc9ed8d

View File

@@ -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);
}
/**