ColorFilter class

A description of a color filter to apply when drawing a shape or compositing a layer with a particular Paint. A color filter is a function that takes two colors, and outputs one color. When applied during compositing, it is independently applied to each pixel of the layer being drawn before the entire layer is merged with the destination.

Instances of this class are used with Paint.colorFilter on Paint objects.

Constructors

ColorFilter.linearToSrgbGamma()
Construct a color filter that applies the sRGB gamma curve to the RGB channels.
const
ColorFilter.matrix(List<double> matrix)
Construct a color filter that transforms a color by a 4x5 matrix. The matrix is in row-major order and the translation column is specified in unnormalized, 0...255, space.
const
ColorFilter.mode(Color color, BlendMode blendMode)
Creates a color filter that applies the blend mode given as the second argument. The source color is the one given as the first argument, and the destination color is the one from the layer being composited. [...]
const
ColorFilter.srgbToLinearGamma()
Creates a color filter that applies the inverse of the sRGB gamma curve to the RGB channels.
const

Properties

hashCode int
The hash code for this object. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override