copyWith method

  1. @override
PColorRGB copyWith({
  1. int? r,
  2. int? g,
  3. int? b,
  4. double? alpha,
})
override

Implementation

@override
PColorRGB copyWith({int? r, int? g, int? b, double? alpha}) {
  if (alpha == null || alpha == 1.0) {
    return PColorRGB(r ?? this.r, g ?? this.g, b ?? this.b);
  } else {
    return PColorRGBA(r ?? this.r, g ?? this.g, b ?? this.b, alpha);
  }
}