zigzag()v4.0.471
Part of the @remotion/effects package.
Adds repeating zig-zag bands to canvas-based components such as <Video>, <HtmlInCanvas> and <Solid>.
It uses the same band controls as lines(), and the same displacement controls as waves(), but uses sharp triangular turns.
Preview
Example
MyComp.tsximport {zigzag } from '@remotion/effects/zigzag'; import {AbsoluteFill ,Solid ,useCurrentFrame } from 'remotion'; export constMyComp :React .FC = () => { constframe =useCurrentFrame (); return ( <AbsoluteFill > <Solid width ={1280}height ={720}effects ={[zigzag ({colors : ['#d7b8ff', 'transparent'],direction : 'horizontal',thickness : 40,gap : 0,angle : 0,offset :frame * 2,amplitude : 40,wavelength : 160, }), ]} /> </AbsoluteFill > ); };
API
Pass an object with the following properties. You can also call zigzag() without arguments.
colors?
An array of color strings for the bands. Colors are assigned cyclically. Must contain at least 2 colors.
Defaults to ['#dff4ff', '#7cc6ff'].
direction?
Base band direction before zig-zag displacement. Either 'horizontal' or 'vertical'. Defaults to 'horizontal'.
thickness?
Thickness of each band in pixels. Defaults to 40.
gap?
Transparent gap in pixels between each band. Defaults to 0.
With gap: 0 (the default), bands are packed solid with no gap between them — colors are directly adjacent to each other.
With gap > 0, a transparent band appears between each stripe, allowing the source content to show through.
angle?
Rotates the pattern in degrees. Defaults to 0.
offset?
Offset in pixels. Defaults to 0.
Animate this value with useCurrentFrame() to scroll the bands.
amplitude?
Zig-zag displacement in pixels. Defaults to 40.
wavelength?
Distance in pixels before the zig-zag repeats. Defaults to 160. Must be greater than 0.
disabled?
When true, the effect is skipped. Defaults to false.
Requirements
zigzag() uses a WebGL2 backend. During renders, enable WebGL via Config.setChromiumOpenGlRenderer() (for example 'angle'). See Using WebGL during renders.