A shader (as used by Paint.shader) that renders a color gradient.

There are two useful types of gradients, created by new Gradient.linear and new Griadent.radial.

Inheritance

Constructors

Gradient()

Creates a Gradient object that is not initialized.

Gradient.linear(List<Point> endPoints, List<Color> colors, [ List<double> colorStops = null, TileMode tileMode = TileMode.clamp ])

Creates a linear gradient from endPoint[0] to endPoint[1]. If colorStops is provided, colorStops[i] is a number from 0 to 1 that specifies where color[i] begins in the gradient. If colorStops is not provided, then two stops at 0.0 and 1.0 are implied. The behavior before and after the radius is described by the tileMode argument.

Gradient.radial(Point center, double radius, List<Color> colors, [ List<double> colorStops = null, TileMode tileMode = TileMode.clamp ])

Creates a radial gradient centered at center that ends at radius distance from the center. If colorStops is provided, colorStops[i] is a number from 0 to 1 that specifies where color[i] begins in the gradient. If colorStops is not provided, then two stops at 0.0 and 1.0 are implied. The behavior before and after the radius is described by the tileMode argument.

Properties

hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited