copyWith method

  1. @override
CmykColor copyWith({
  1. num? cyan,
  2. num? magenta,
  3. num? yellow,
  4. num? black,
  5. int? alpha,
})

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

Implementation

@override
CmykColor copyWith({
  num? cyan,
  num? magenta,
  num? yellow,
  num? black,
  int? alpha,
}) {
  assert(cyan == null || (cyan >= 0 && cyan <= 100));
  assert(magenta == null || (magenta >= 0 && magenta <= 100));
  assert(yellow == null || (yellow >= 0 && yellow <= 100));
  assert(black == null || (black >= 0 && black <= 100));
  assert(alpha == null || (alpha >= 0 && alpha <= 255));
  return CmykColor(
    cyan ?? this.cyan,
    magenta ?? this.magenta,
    yellow ?? this.yellow,
    black ?? this.black,
    alpha ?? this.alpha,
  );
}