Voronoi

Installation

npm i @paper-design/shaders-react

Code

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

<Voronoi
  style={{ height: 500 }}
  colorGlow="#ffffff"
  colorGap="#2e0000"
  stepsPerColor={3}
  distortion={0.4}
  gap={0.04}
  glow={0}
  scale={0.5}
  rotation={0}
  speed={0.5}
  colors={["#cc3333","#cc9933"]}
/>

Props

NameDescriptionTypeValues
colorsBase cell colors (up to 10)string[]Hex, RGB, or HSL color
colorGapColor used for cell borders/gapsstringHex, RGB, or HSL color
colorGlowColor tint for the radial inner shadow effect inside cells (effective with glow > 0)stringHex, RGB, or HSL color
stepsPerColorNumber of extra colors between base colors (1 = N color palette, 2 = 2×N color palette, 3 = 3×N color palette, etc)number1 to 3 (integer)
distortionStrength of noise-driven displacement of cell centersnumber0 to 0.5
gapWidth of the border/gap between cellsnumber0 to 0.1
glowStrength of the radial inner shadow inside cellsnumber0 to 1
scaleOverall zoom level of the graphicsnumber0.01 to 4
rotationOverall rotation angle of the graphicsnumber0 to 360
speedAnimation speednumber0 to 1

Description

Anti-aliased animated Voronoi pattern with smooth and customizable edges.