copyWith abstract method

  1. @override
P copyWith(
  1. P pixel, {
  2. C? red,
  3. C? green,
  4. C? blue,
})
override

Returns a copy of the pixel.

Subclasses override this method to provide named parameters for channels.

Example

print(abgr8888.copyWith(0x12345678, red: 0x9A)); // 0x9A345678
print(floatRgba.copyWith(Float32x4(0.1, 0.2, 0.3, 0.4), red: 0.5)); // [0.5, 0.2, 0.3, 0.4]

Implementation

@override
P copyWith(
  P pixel, {
  C? red,
  C? green,
  C? blue,
});