Skip to content

pantoken / design/swatches/src / toSvg

Fušla: toSvg()

toSvg(swatches, options?): string

Eksperimentála

Geahččal gávnnat gruppearrovin SVG-speceaminašša.

Parametera

swatches

čállin olgguheapmi Swatch[]

Palettta (d. b. toSwatches).

options?

ToSvgOptions = {}

ToSvgOptions.

Gullii / Gávdnat

string

SVG-dokumena mii lea rievdun.

Exempla

Geahččal speceaminašša README:sii

ts
import { writeFileSync } from "node:fs";
import { swatches, toSvg } from "@pantoken/swatches";

writeFileSync("palette.svg", toSvg(swatches));

Speceamina doarjušat ealáhuspalettta, pealkain ja stuorra ruovttoluhtte

ts
import { swatches, toSvg } from "@pantoken/swatches";

const core = swatches.filter((s) => !s.name.startsWith("primitive-"));
const svg = toSvg(core, { title: "Instructure core colors", columns: 8 });