Skip to content

textmode.synth.js / voronoi

Function: voronoi()

ts
function voronoi(
   scale?, 
   speed?, 
   blending?): SynthSource;

Generate voronoi patterns.

Parameters

ParameterTypeDescription
scale?number | number[] | (ctx) => numberScale of voronoi cells (default: 5.0)
speed?number | number[] | (ctx) => numberAnimation speed (default: 0.3)
blending?number | number[] | (ctx) => numberBlending between cell regions (default: 0.3)

Returns

SynthSource

Example

javascript
const t = textmode.create({
  width: window.innerWidth,
  height: window.innerHeight,
  plugins: [SynthPlugin]
});

t.layers.base.synth(
  voronoi(6, 0.4, 0.2)
    .color(0.8, 0.4, 1.2)
);

t.windowResized(() => {
  t.resizeCanvas(window.innerWidth, window.innerHeight);
});