copyWith method

  1. @override
XyzColor copyWith({
  1. num? x,
  2. num? y,
  3. num? z,
  4. int? alpha,
})

Returns a copy of this color modified with the provided values.

Implementation

@override
XyzColor copyWith({
  num? x,
  num? y,
  num? z,
  int? alpha,
}) {
  assert(x == null || x >= 0);
  assert(y == null || y >= 0);
  assert(z == null || z >= 0);
  assert(alpha == null || (alpha >= 0 && alpha <= 255));
  return XyzColor(
    x ?? this.x,
    y ?? this.y,
    z ?? this.z,
    alpha ?? this.alpha,
  );
}