rgbScale function

void rgbScale(
  1. Uint8List bytes,
  2. num red,
  3. num green,
  4. num blue
)

Implementation

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