Closed
Description
Currently our support for color filters is just a subset of what SKIA supports.
One simple color filter transformation that isn't currently possible is displaying a color image as grayscale.
In SKIA terms this isn't exactly intuitive, but it's possible:
// See https://skia.org/user/api/skpaint
SkScalar grayscale[20] = {
0.21, 0.72, 0.07, 0.0, 0.0,
0.21, 0.72, 0.07, 0.0, 0.0,
0.21, 0.72, 0.07, 0.0, 0.0,
0.0, 0.0, 0.0, 1.0, 0.0};
SkPaint paint;
paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(grayscale));
Most of the predefined CSS filters (grayscale is among them) seem like a reasonable and intuitive set to support explicitly in Flutter. Likewise for the CSS support for just stringing together a list of predefined filters.