addictiveColor function

void addictiveColor(
  1. Uint8List bytes,
  2. int red,
  3. int green,
  4. int blue,
)

Implementation

void addictiveColor(Uint8List bytes, int red, int green, int blue) {
  for (int i = 0; i < bytes.length; i += 4) {
    bytes[i] = clampPixel(bytes[i] + red);
    bytes[i + 1] = clampPixel(bytes[i + 1] + green);
    bytes[i + 2] = clampPixel(bytes[i + 2] + blue);
  }
}