Skip to content

pantoken / design/swatches/src / toGpl

Funktion: toGpl()

toGpl(swatches, options?): string

Experimentell

Farbfelder als GIMP .gpl-Palettenzeichenfolge codieren.

Parameter

swatches

schreibgeschützt Swatch[]

Die Palette.

options?

ToGplOptions = {}

ToGplOptions.

Rückgabe

string

Beispiele

Eine GIMP .gpl-Palette schreiben

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

writeFileSync("instructure.gpl", toGpl(swatches));

Mit einem benutzerdefinierten Palettennamen

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

const gpl = toGpl(swatches, { name: "Instructure Rebrand" });