public static Image changeColor(Image image, Color oldColor, Color newColor) {
		Objects.requireNonNull(image);

		BufferedImage srcImage = new BufferedImage(image.getWidth(null), image.getHeight(null),
			BufferedImage.TYPE_INT_ARGB);
		Graphics graphics = srcImage.getGraphics();
		graphics.drawImage(image, 0, 0, null);
		graphics.dispose();

		int[] oldRgb = new int[] { oldColor.getRed(), oldColor.getGreen(), oldColor.getBlue() };
		int[] newRgb = new int[] { newColor.getRed(), newColor.getGreen(), newColor.getBlue() };

		BufferedImage destImage = new BufferedImage(image.getWidth(null), image.getHeight(null),
			BufferedImage.TYPE_INT_ARGB);
		LookupTable table = new LookupTable(0, 4) {
			@Override
			// overridden to pass in the complete pixel data
			public int[] lookupPixel(int[] src, int[] dest) {
				return filterRgbChangeColor(src, dest, oldRgb, newRgb);
			}
		};

		LookupOp lookupOp = new LookupOp(table, null);
		lookupOp.filter(srcImage, destImage);
		return destImage;
	}
Creates a new image that is the same as the given image but has the given colored 
pixels replaced with the given new color

@param image the image to change
@param oldColor the color to replace
@param newColor the color to use
@return the new image
Ghidra/Framework/Gui/src/main/java/generic/util/image/ImageUtils.java