copyWith method

  1. @override
LabColor copyWith({
  1. num? lightness,
  2. num? a,
  3. num? b,
  4. int? alpha,
})
override

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

Implementation

@override
LabColor copyWith({num? lightness, num? a, num? b, int? alpha}) {
  assert(lightness == null || (lightness >= 0 && lightness <= 100));
  assert(a == null || (a >= -128 && a <= 127));
  assert(b == null || (b >= -128 && b <= 127));
  assert(alpha == null || (alpha >= 0 && alpha <= 255));
  return LabColor(
    lightness ?? this.lightness,
    a ?? this.a,
    b ?? this.b,
    alpha ?? this.alpha,
  );
}