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

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorsUp to 7 colors used in the gradientstring[]Hex, RGB, or HSL color
softnessColor transition sharpness (0 = hard edge, 1 = smooth gradient)number0 to 1
intensityDistortion between color bandsnumber0 to 1
noiseGrainy noise overlaynumber0 to 1
shapeShape typeenum
| "wave" | "dots" | "truchet" | "corners" | "ripple" | "blob" | "sphere"
offsetXHorizontal offset of the graphics centernumber-1 to 1
offsetYVertical offset of the graphics centernumber-1 to 1
scaleOverall zoom level of the graphicsnumber0.01 to 4
rotationOverall rotation angle of the graphicsnumber0 to 360
speedAnimation speednumber0 to 2

Description

Multi-color gradients with grainy, noise-textured distortion available in 7 animated abstract forms