Color withGreen(int g)

Returns a new color that matches this color with the green channel replaced with g.

Source

Color withGreen(int g) {
  return new Color.fromARGB(alpha, red, g, blue);
}