Function Color.withAlpha

Adjust a Colors alpha channel, setting it to the given percentage.

Color withAlpha (
  float alpha
) const;

Returns

A newly adjusted Color.

Throws

A RangeError if the given alpha component is outside the range 0.0 through 1.0.