withOpacity method

  1. @override
XyzColor withOpacity(
  1. double opacity
)
override

Returns this ColorModel with the provided opacity value.

opacity is the equivalent of alpha normalized to a 0 to 1 value.

Implementation

@override
XyzColor withOpacity(double opacity) {
  assert(opacity >= 0.0 && opacity <= 1.0);
  return copyWith(alpha: (opacity * 255).round());
}