mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 21:42:53 +02:00
Improve method
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user