Dithering

Installation

npm i @paper-design/shaders-react

Code

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

<Dithering
  style={{ height: 500 }}
  colorBack="#000000"
  colorFront="#00b3ff"
  shape="sphere"
  type="4x4"
  pxSize={2}
  offsetX={0}
  offsetY={0}
  scale={0.6}
  rotation={0}
  speed={1}
/>

Props

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorFrontThe foreground (ink) colorstringHex, RGB, or HSL color
pxSizePixel size of dithering gridnumber1 to 20
shapeShape pattern typeenum
| "simplex" | "warp" | "dots" | "wave" | "ripple" | "swirl" | "sphere"
typeDithering typeenum
| "random" | "2x2" | "4x4" | "8x8"
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

Animated 2-color dithering over with multiple pattern sources (noise, warp, dots, waves, ripple, swirl, sphere). Great for retro, print-like, or stylized UI textures.