toHSV property

  1. @override
HSVColor toHSV
override

Convert this to a HSV color space

Implementation

@override
HSVColor get toHSV {
  final hslSaturation = this.saturation / 100;
  final lightness = this.lightness / 100;

  final value = lightness + hslSaturation * min(lightness, 1 - lightness);
  final saturation = value == 0 ? 0 : 2 * (1 - lightness / value);

  return HSVColor(hue: hue, saturation: saturation * 100, value: value * 100);
}