ColorGradient class Particles
A color curve over normalized time [0, 1], baked into a lookup table.
Like ParticleCurve but for linear RGBA colors. Used for color-over-life gradients. Linearly interpolates between stops and clamps to the first/last color outside their range.
Constructors
-
ColorGradient(List<
ColorStop> stops, {int resolution = 64}) -
Builds a gradient from
stops, baked into aresolution-entry table. - ColorGradient.constant(Vector4 color)
-
A gradient that is
coloreverywhere.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- resolution → int
-
The number of baked lookup-table entries (each four floats).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stops
→ List<
ColorStop> -
The source color stops, sorted by time, retained so the gradient can be
serialized and edited (the sample path uses the baked table).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sample(
double t, [Vector4? out]) → Vector4 -
Samples the gradient at normalized time
t(clamped into[0, 1]), writing the result intoout(allocated when null) and returning it. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited