greyscale constant

ColorFilter const greyscale

A color filter that converts the content to grayscale.

This filter applies a color matrix that sets all three color channels to the average of the original pixel value, effectively converting the content to grayscale.

Implementation

static const ColorFilter greyscale = ColorFilter.matrix(<double>[
  0.2126, 0.7152, 0.0722, 0, 0, //
  0.2126, 0.7152, 0.0722, 0, 0, //
  0.2126, 0.7152, 0.0722, 0, 0, //
  0, 0, 0, 1, 0 //
]);