withOpacity method

  1. @override
Color withOpacity(
  1. double apacity
)
override

Returns a new color that matches this color with the alpha channel replaced with the given opacity (which ranges from 0.0 to 1.0).

Out of range values will have unexpected effects.

Implementation

@override
Color withOpacity(double apacity) {
  return withAlpha((255.0 * opacity).round());
}