hueSaturation function

RGBA hueSaturation(
  1. RGBA color,
  2. num adj
)

Implementation

RGBA hueSaturation(RGBA color, num adj) {
  var hsv = imageUtils.rgbToHsv(color.red, color.green, color.blue);
  hsv[1] = (hsv[1] ?? 0) * adj;
  var rgb = imageUtils.hsvToRgb(hsv[0]!, hsv[1]!, hsv[2]!);
  return new RGBA(
    red: clampPixel(rgb[0] as int),
    green: clampPixel(rgb[1] as int),
    blue: clampPixel(rgb[2] as int),
    alpha: color.alpha,
  );
}