VectorComposite.SpreadMode
EnumHow a gradient extends beyond its [0, 1] parameter range.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — Available on SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — Available on SPECS only
- Camera Kit MobileNot supported — Available on SPECS only
Since Lens Scripting v370
How a gradient extends beyond its [0, 1] parameter range. Mirrors the SVG
spreadMethod attribute. Pass to VectorGradientBuilder#setSpread.
Index
Example
var gb = VectorGradientBuilder.linear(new vec2(0, 0), new vec2(128, 0));
gb.addColorStop(0.0, new vec4(1, 0, 0, 1));
gb.addColorStop(1.0, new vec4(0, 0, 1, 1));
// Mirror the ramp past its [0, 1] range instead of clamping (the Pad default).
gb.setSpread(VectorComposite.SpreadMode.Reflect);
var gradient = gb.build();
Enumeration Members
Pad
Pad:
number
SPECS
Clamp to the end stops: the first stop color fills everything before the gradient's start, and the last stop color everything after its end. This is the default.
Since
Lens Scripting Version 370
Reflect
Reflect:
number
SPECS
Reflect (mirror) the gradient pattern repeatedly beyond its range.
Since
Lens Scripting Version 370
Repeat
Repeat:
number
SPECS
Repeat (tile) the gradient pattern beyond its range.
Since
Lens Scripting Version 370