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
.
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]
toendPoint[1]
. IfcolorStops
is provided,colorStops[i]
is a number from 0 to 1 that specifies wherecolor[i]
begins in the gradient. IfcolorStops
is not provided, then two stops at 0.0 and 1.0 are implied. The behavior before and after the radius is described by thetileMode
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 atradius
distance from the center. IfcolorStops
is provided,colorStops[i]
is a number from 0 to 1 that specifies wherecolor[i]
begins in the gradient. IfcolorStops
is not provided, then two stops at 0.0 and 1.0 are implied. The behavior before and after the radius is described by thetileMode
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