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;
    scale?: number;
    speed?: number;
}
PropertyTypeDefaultDescription
cellsnumber20Number of Voronoi cells.
colorsstring[]['#ff6b6b', '#4ecdc4', '#45b7d1', '#f9ca24', '#6c5ce7', '#fd79a8', '#00b894', '#e17055']Colors used for filling cells.
edgeColorstring'#ffffff'Color of cell edges.
edgeWidthnumber2Width of cell edges in pixels.
scalenumber1Scales all sizes proportionally.
speednumber0.5Drift speed of seed points.