Mesh Gradient
Installation
npm i @paper-design/shaders-react
Code
import { MeshGradient } from '@paper-design/shaders-react';
<MeshGradient
height={500}
colors={["#cc3333", "#cc9933", "#99cc33", "#33cc33"]}
distortion={0.8}
swirl={0.1}
offsetX={0}
offsetY={0}
scale={1}
rotation={0}
speed={1}
/>
Props
| Name | Description | Type | Values |
|---|---|---|---|
| colors | Up to 10 color spots | string[] | Hex, RGB, or HSL color |
| distortion | The power of organic noise distortion | number | 0 to 1 |
| swirl | The power of vortex distortion | number | 0 to 1 |
| offsetX | Horizontal offset of the graphics center | number | -1 to 1 |
| offsetY | Vertical offset of the graphics center | number | -1 to 1 |
| width | CSS width style of the shader element | number | string | — |
| height | CSS height style of the shader element | number | string | — |
| scale | Overall zoom level of the graphics | number | 0.01 to 4 |
| rotation | Overall rotation angle of the graphics | number | 0 to 360 |
| speed | Animation speed | number | 0 to 2 |
Description
A flowing interplay of color spots, moving along distinct trajectories and transformed by organic distortion.