toHSV method
Converts this colour to its HSVColour representation.
Implementation
@override
HSVColour toHSV() {
final double red = color.r / 0xFF;
final double green = color.g / 0xFF;
final double blue = color.b / 0xFF;
final double max = math.max(red, math.max(green, blue));
final double min = math.min(red, math.min(green, blue));
final double delta = max - min;
final double alpha = color.a / 0xFF;
final double hue = ColourSpace.getHue(red, green, blue, max, delta);
final double saturation = max == 0.0 ? 0.0 : delta / max;
return HSVColour.fromAHSV(alpha, hue, saturation, max);
}