colorWithAlpha static method

Color colorWithAlpha(
  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 colorWithAlpha(Color color, int? alpha) {
  return alpha != null ? color.withAlpha(alpha) : color;
}