createNormalized method

  1. @override
P createNormalized({
  1. double red = 0.0,
  2. double green = 0.0,
  3. double blue = 0.0,
  4. double alpha = 1.0,
})
override

Creates a new pixel with the given channel values normalized to the range [0.0, 1.0].

The red, green, and blue values are optional.

If omitted, the corresponding channel value is set to 0.0.

Example

// Creating a full red pixel.
final pixel = rgb.createNormalized(red: 1.0);

Implementation

@override
P createNormalized({
  double red = 0.0,
  double green = 0.0,
  double blue = 0.0,
  double alpha = 1.0,
}) {
  return copyWithNormalized(
    zero,
    red: red,
    green: green,
    blue: blue,
    alpha: alpha,
  );
}