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
tprogresses from0.0 -> 1.0) by lerping any entries that fall within a shared common list length range and adding any potential extra entries sourced frombastgrows while removing any potential extra entries sourced fromaastgrows.factory - PrimitiveGradient.from(Gradient gradient)
-
Dissolve a Gradient into a
PrimitiveGradient.factory - PrimitiveGradient.fromStretchLerp(dynamic a, dynamic b, double t)
-
Interpolate two
Gradients' orPrimitiveGradients' colors and stops att.factory
Properties
-
colors
→ List<
Color> -
The interpolated colors of the true Gradients that this
PrimitiveGradientboils 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
PrimitiveGradientboils 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
nullusingfactoras the keyframet. -
stretchedTo(
int length) → PrimitiveGradient -
Force this PrimitiveGradient to have
lengthnumber 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
tfrom a configured list ofstops. -
sameLengthLerp(
PrimitiveGradient a, PrimitiveGradient b, double t) → PrimitiveGradient -
Linearally interpolate between
PrimitiveGradientsaandbat any given keyframe (double)t, generally0.0 .. 1.0. -
sample(
List< Color> colors, List<double> stops, double t) → Color -
Calculate the color at position
tof the gradient defined bycolorsandstops.
Modified from vanilla Gradient_sample()to support fewerColors.