-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: galleryRelating to flutter/gallery repository. Please transfer non-framework issues there.Relating to flutter/gallery repository. Please transfer non-framework issues there.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
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.
Metadata
Metadata
Assignees
Labels
c: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: galleryRelating to flutter/gallery repository. Please transfer non-framework issues there.Relating to flutter/gallery repository. Please transfer non-framework issues there.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.