simplex noise

A multi-colour gradient mapped onto a smooth, animated combination of two simplex noises. Pure palette and softness — no other knobs needed.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

import { SimplexNoise } from '@devmischief/shaders-svelte';

<SimplexNoise
  width={1280}
  height={720}
  colors={['#3a86ff', '#06d6a0', '#ffd166', '#ef476f', '#8338ec']}
  stepsPerColor={2}
  softness={0}
  scale={0.2}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={2}
  fit="none"
/>
			
			

Shader Props

5
namedescriptiontypevalues
colorsBase palette colors (up to 10).string[]hex / rgb
stepsPerColorExtra interpolated colors generated between each pair of base colors. 1 = N colors, 10 = 10×N.number1 → 10
softnessColor transition sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
speedAnimation speed of the drifting noise.number0 → 3
fitHow the noise field is fit into the canvas.stringnone · cover · contain

Common Props

6
namedescriptiontypevalues
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
worldWidthVirtual width of the graphic before it's scaled to fit the canvas.number
worldHeightVirtual height of the graphic before it's scaled to fit the canvas.number
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte