distanceTo method
- Color color
Calculates the distance between this HSVColor and the provided color
.
The distance is calculated by taking the absolute difference between the hue,
saturation, and brightness values of this color and the provided color
,
and summing them up.
Returns the calculated distance.
Implementation
double distanceTo(Color color) {
var h = (hue - color.hue).abs();
var s = (saturation - color.saturation).abs();
var v = (brightness - color.brightness).abs();
return h + s + v;
}