Static Radial Gradient

Installation

npm i @paper-design/shaders-react

Code

import { StaticRadialGradient } from '@paper-design/shaders-react';

<StaticRadialGradient
  style={{ height: 500 }}
  colorBack="#000000"
  radius={0.8}
  focalDistance={0.99}
  focalAngle={0}
  falloff={0.24}
  mixing={0.35}
  distortion={0}
  distortionShift={0}
  distortionFreq={12}
  grainMixer={0}
  grainOverlay={0}
  offsetX={0}
  offsetY={0}
  colors={["#cc3333","#cc9933","#99cc33"]}
/>

Props

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorsUp to 10 colors used in the gradientstring[]Hex, RGB, or HSL color
radiusThe size of the shapenumber0 to 3
focalDistanceDistance of the focal point from centernumber0 to 3
focalAngleAngle of the focal point in degrees (effective with focalDistance > 0)number0 to 360
falloffGradient decay (0 for linear gradient)number-1 to 1
mixingBlending behavior (sharper vs. smoother color transitions)number0 to 1
distortionStrength of radial distortionnumber0 to 1
distortionShiftRadial distortion offset (effective with distortion > 0)number-1 to 1
distortionFreqRadial distortion frequency (effective with distortion > 0)number0 to 20 (integer)
grainMixerStrength of grain distortion applied to color edgesnumber0 to 1
grainOverlayPost-processing RGB grain overlaynumber0 to 1
offsetXHorizontal offset of the graphics centernumber-1 to 1
offsetYVertical offset of the graphics centernumber-1 to 1

Description

Radial gradient with up to 10 blended colors, featuring advanced focal point control, shape distortion, and grain effects