Skip to content

pantoken / design/swatches/src / toSvg

Feidhm: toSvg()

toSvg(swatches, options?): string

Turgnamhach

Rindreáil sámplaí dathanna mar leathán sampla SVG grúpáilte.

Paraiméadair

swatches

léamh-aonair Swatch[]

An phailéad (m.sh. ó toSwatches).

options?

ToSvgOptions = {}

ToSvgOptions.

Tuairisceáin

string

An doiciméad SVG mar shlabhra téacs.

Samplaí

Rindreáil leathán sampla do README

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

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

Sampla den phailéad bhunúsach amháin, le teideal agus greille níos leithne

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 });