colorOverlay function

RGBA colorOverlay (RGBA color, num red, num green, num blue, num scale)

Implementation

RGBA colorOverlay(RGBA color, num red, num green, num blue, num scale) {
  return new RGBA(
    red: clampPixel((color.red - (color.red - red) * scale).round()),
    green: clampPixel((color.green - (color.green - green) * scale).round()),
    blue: clampPixel((color.blue - (color.blue - blue) * scale).round()),
    alpha: color.alpha,
  );
}