withGreen method

Color withGreen(
  1. int g
)

Returns a new color that matches this color with the green channel replaced with g (which ranges from 0 to 255).

Out of range values will have unexpected effects.

Implementation

Color withGreen(int g) {
  return Color.fromARGB((a * 255.0).round() & 0xff,
      (r * 255.0).round() & 0xff, g, (b * 255.0).round() & 0xff);
}