ColorDistanceInterface

Interface

Interface 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
NameTypeDefault
$color1 ColorInterface -
$color2 ColorInterface -
public function getName(): string

Get the name of the algorithm.