create method
- C? red,
- C? green,
- C? blue,
Creates a new pixel with the given channel values.
The red
, green
, and blue
values are optional.
If omitted, the corresponding channel value is set to the minimum value.
Example
// Creating a full red pixel.
final pixel = rgb.create(red: 0xFF);
Implementation
P create({
C? red,
C? green,
C? blue,
}) {
return copyWith(
zero,
red: red ?? minRed,
green: green ?? minGreen,
blue: blue ?? minBlue,
);
}