Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

layerFill

layerFill(options?): FragmentLayer

Defined in: packages/sigma/src/rendering/nodes/layers/fill.ts:45

Creates a fill layer that fills the shape with a color. This is typically the base layer for most node programs.

Parameters

options?

LayerFillOptions

Optional configuration

Returns

FragmentLayer

Fill layer definition

Example

// Use node color (default)
const program = createNodeProgram({
shapes: [sdfCircle()],
layers: [layerFill()],
});
// Use fixed color
const redProgram = createNodeProgram({
shapes: [sdfCircle()],
layers: [layerFill({ color: "#ff0000" })],
});
// Use a custom attribute
const customProgram = createNodeProgram({
shapes: [sdfCircle()],
layers: [layerFill({ color: { attribute: "fillColor" } })],
});