Skip to content

pantoken / design/swatches/src / toSvg

Fonksyon: toSvg()

toSvg(swatches, options?): string

Eksperimantal

Rann echantiyon koulè yo kòm yon fèy echantiyon SVG gwoupe.

Paramèt

swatches

sèlman-lekti Swatch[]

Palèt la (pa egzanp soti nan toSwatches).

options?

ToSvgOptions = {}

ToSvgOptions.

Retounen

string

Dokiman SVG la kòm yon chèn karaktè.

Egzanp

Rann yon fèy echantiyon pou yon README

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

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

Echantiyone sèlman palèt nwayo a, avèk yon tit ak yon gri pi laj

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