withAlpha static method

Color? withAlpha(
  1. Color? color,
  2. int? alpha
)

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

Implementation

static Color? withAlpha(Color? color, int? alpha) {
  return alpha != null ? color?.withAlpha(alpha) : color;
}