layerBorder
layerBorder(
options?):FragmentLayer
Defined in: packages/node-border/src/layer.ts:218
Creates a border layer that renders one or more concentric borders around a shape. The borders follow the contour of whatever SDF shape is used.
Parameters
options?
FactoryOptionsFromSchema<{ borders: ArrayPropertySchema<{ color: PropertySchema<string, "color", true>; fill: PropertySchema<boolean, "boolean", false>; mode: PropertySchema<"relative" | "pixels", EnumPropertyType<"relative" | "pixels">, boolean>; size: PropertySchema<number, "number", true>; }>; }>
Border configuration options
Returns
FragmentLayer definition
Example
// Simple border with fillconst borderLayer = layerBorder({ borders: [ { size: 0.1, color: { attribute: "borderColor" }, mode: "relative" }, { size: 0, color: { attribute: "color" }, fill: true }, ],});
// Use with createNodeProgramconst program = createNodeProgram({ shapes: [sdfSquare({ cornerRadius: 0.1 })], layers: [borderLayer],});