ColorDistanceInterface
InterfaceInterface for color distance calculation algorithms.
Defines the contract for algorithms that measure the perceptual difference
between two colors.
Methods
public function calculate(ColorInterface $color1, ColorInterface $color2): float
Calculate the perceptual difference between two colors.
Returns a numeric value representing the perceptual difference, where:
- 0 means the colors are identical
- Larger values indicate greater perceptual difference
- The scale and interpretation depend on the specific algorithm
Parameters
| Name | Type | Default |
|---|---|---|
$color1 |
ColorInterface | - |
$color2 |
ColorInterface | - |