toHslColor method

HslColor toHslColor()
override

Implementation

HslColor toHslColor() {
  num hsvSaturation = s / 100;
  num value = v / 100;

  num lightness = value * (1 - hsvSaturation / 2);
  num saturation = lightness == 0 || lightness == 1
      ? 0
      : (value - lightness) / min(lightness, 1 - lightness);

  return HslColor(h, saturation * 100, lightness * 100);
}