convertColoredPartsToWhite function

  1. @visibleForTesting
Image convertColoredPartsToWhite(
  1. Image image
)

Implementation

@visibleForTesting
Image convertColoredPartsToWhite(Image image) {
  for (int x = 0; x < image.width; x++) {
    for (int y = 0; y < image.height; y++) {
      // ピクセルの色を取得します。
      final pixel = image.getPixel(x, y);
      if (pixel.a == 0) {
        continue;
      }
      image.palette?.setRgba(pixel.index.toInt(), 255, 255, 255, 255);
    }
  }
  return image;
}