Linear Gradient Fill. Replaces the flat front color. The gradient is laid across the particle's own box, so it rotates, flips and scales with the particle. The back side (when flipped) still uses backColor.
backColor
paper: { gradient: { colors: ["#ffd700", "#ff8c00"], angle: 45 } } Copy
paper: { gradient: { colors: ["#ffd700", "#ff8c00"], angle: 45 } }
Creates one CanvasGradient per particle at spawn time (no per-frame cost).
CanvasGradient
Optional
Readonly
Gradient Direction. 0 runs left → right, 90 bottom → top.
0
90
Gradient Color Stops. At least two colors, spread evenly from start to end.
Linear Gradient Fill. Replaces the flat front color. The gradient is laid across the particle's own box, so it rotates, flips and scales with the particle. The back side (when flipped) still uses
backColor.Example
Remarks
Creates one
CanvasGradientper particle at spawn time (no per-frame cost).