Skip to main content

repeatingLinearGradient()v4.0.549

Part of the @remotion/effects package.

Fills a layer with a repeating two-color gradient. The line from start to end sets the direction and length of one repeat. The gradient repeats in both directions and replaces the source pixels.

Preview​

Drag current effect onto a layer in the Studio

Example​

This example draws eight horizontal bands. Each band fades from gold to dark brown before the next one starts.

MyComp.tsx
import {repeatingLinearGradient} from '@remotion/effects/repeating-linear-gradient'; import {Solid} from 'remotion'; export const MyComp: React.FC = () => { return ( <Solid width={1280} height={720} effects={[ repeatingLinearGradient({ start: [0.5, 0], end: [0.5, 0.125], startColor: '#e49a35', endColor: '#361b0c', }), ]} /> ); };

API​

All properties are optional. Calling repeatingLinearGradient() uses the defaults below.

start?​

The point where a repeat begins, as an [x, y] tuple. [0, 0] is the top-left corner of the layer and [1, 1] is the bottom-right. Defaults to [0.5, 0].

end?​

The point where the next repeat begins, in the same coordinates as start. Moving end closer to start makes the bands narrower. If the two points coincide, the layer is filled with startColor. Defaults to [0.5, 0.12].

startColor?​

The CSS color at the beginning of each repeat. Defaults to '#e49a35'.

endColor?​

The CSS color each band fades toward before the gradient restarts at startColor. Defaults to '#361b0c'.

disabled?​

When true, the effect is skipped. Defaults to false.

Implementations​

  • WebGL2
  • WebGPU

See Preferred effect backend.

Compatibility​

BrowsersEnvironments
Chrome
Firefox
Safari

See also​