Grain Gradient
Installation
npm i @paper-design/shaders-react
Code
import { GrainGradient } from '@paper-design/shaders-react';
<GrainGradient
style={{ height: 500 }}
colorBack="#000000"
softness={0.5}
intensity={0.5}
noise={0.25}
shape="corners"
offsetX={0}
offsetY={0}
scale={1}
rotation={0}
speed={1}
colors={["#cc3333","#cc9933","#99cc33","#33cc33"]}
/>
Props
| Name | Description | Type | Values |
|---|---|---|---|
| colorBack | Background color | string | Hex, RGB, or HSL color |
| colors | Up to 7 colors used in the gradient | string[] | Hex, RGB, or HSL color |
| softness | Color transition sharpness (0 = hard edge, 1 = smooth gradient) | number | 0 to 1 |
| intensity | Distortion between color bands | number | 0 to 1 |
| noise | Grainy noise overlay | number | 0 to 1 |
| shape | Shape type | enum | | "wave" | "dots" | "truchet" | "corners" | "ripple" | "blob" | "sphere" |
| offsetX | Horizontal offset of the graphics center | number | -1 to 1 |
| offsetY | Vertical offset of the graphics center | number | -1 to 1 |
| 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
Multi-color gradients with grainy, noise-textured distortion available in 7 animated abstract forms