PrimitiveGradient class
The most basic representation of a gradient.
- Annotations
Constructors
- PrimitiveGradient.byCombination(Gradient a, Gradient b, double t)
-
Vanilla Flutter gradient merge process.
factory
- PrimitiveGradient.byProgressiveMerge(PrimitiveGradient a, PrimitiveGradient b, double t)
-
This factory constructor will return a PrimitiveGradient whose colors
and stops are progressively merged (as
t
progresses from0.0 -> 1.0
) by lerping any entries that fall within a shared common list length range and adding any potential extra entries sourced fromb
ast
grows while removing any potential extra entries sourced froma
ast
grows.factory - PrimitiveGradient.from(Gradient gradient)
-
Dissolve a Gradient into a
PrimitiveGradient
.factory - PrimitiveGradient.fromStretchLerp(dynamic a, dynamic b, double t)
-
Interpolate two
Gradient
s' orPrimitiveGradient
s' colors and stops att
.factory
Properties
-
colors
→ List<
Color> -
The interpolated colors of the true Gradients that this
PrimitiveGradient
boils down.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stops
→ List<
double> -
The interpolated stops of the true Gradients that this
PrimitiveGradient
boils down.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scale(
double factor) → PrimitiveGradient -
"Scaling" this gradient represents reducing the opacity of all its colors
by Color.lerp with
null
usingfactor
as the keyframet
. -
stretchedTo(
int length) → PrimitiveGradient -
Force this PrimitiveGradient to have
length
number of colors/stops. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
extrapolateStop(
List< double> stops, double t) → double -
Extrapolate the stop at position
t
from a configured list ofstops
. -
sameLengthLerp(
PrimitiveGradient a, PrimitiveGradient b, double t) → PrimitiveGradient -
Linearally interpolate between
PrimitiveGradient
sa
andb
at any given keyframe (double
)t
, generally0.0 .. 1.0
. -
sample(
List< Color> colors, List<double> stops, double t) → Color -
Calculate the color at position
t
of the gradient defined bycolors
andstops
.
Modified from vanilla Gradient_sample()
to support fewerColor
s.