Skip to content

Voronoi API

Voronoi

Extends Effect.

Factory Function

typescript
createVoronoi(config?: VoronoiConfig)

Methods

See Effect for the full method reference.


VoronoiConfig

typescript
interface VoronoiConfig {
    cells?: number;
    colors?: string[];
    edgeColor?: string;
    edgeWidth?: number;
    resolution?: number;
    scale?: number;
    speed?: number;
}
PropertyTypeDefaultDescription
cellsnumber20Number of Voronoi cells.
colorsstring[]['#264653', '#2a9d8f', '#e9c46a', '#f4a261', '#e76f51']Colors used for filling cells.
edgeColorstring'#ffffff'Color of cell edges.
edgeWidthnumber2Width of cell edges in pixels.
resolutionnumber3Pixel resolution for the Voronoi computation.
scalenumber1Scales all sizes proportionally.
speednumber0.5Drift speed of seed points.

VoronoiCell

Represents a single cell in the Voronoi diagram. Used internally by the effect.