qaf12
qaf12

Reputation: 31

How can I implement a filter that inverts colors?

Suppose I want to invert the RGB colors on a widget to produce a "negative" feel, what should I do to achieve that?

Upvotes: 3

Views: 886

Answers (1)

rmtmckenzie
rmtmckenzie

Reputation: 40483

The short answer is that Flutter doesn't support this as far as I know.

Theoretically, if it were to support it, you would use a ShaderMask and simply pass it the corresponding Shader such as InvertColorShader, but there is no shader that does an invert for now.

You could ask for one to be added by creating a bug in the Flutter repository and they might consider it if you describe a convincing use-case.

Upvotes: 1

Related Questions