withAlpha method

Color withAlpha(
  1. int alpha
)

Returns a new Color object with the specified alpha value.

The alpha parameter specifies the new alpha value, which should be between 0 and 255.

Implementation

Color withAlpha(int alpha) {
  assert(0 <= alpha && alpha <= 255);
  return Color.fromARGB(alpha, redValue, greenValue, blueValue);
}