invertAndPreserve method

Color invertAndPreserve()

Implementation

Color invertAndPreserve() {
  // Invert the color but keep the hue and saturation

  var hsv = toHSV();
  var h = hsv[0];
  var s = hsv[1];
  var v = hsv[2];

  return Color.FromHSV(h: h, s: s, v: 1 - v);
}