Skip to content

pantoken / design/swatches/src / toGpl

Fonction: toGpl()

toGpl(swatches, options?): string

Expérimental

Encoder les nuanciers en une chaîne de palette GIMP .gpl.

Paramètres

swatches

lecture seule Swatch[]

La palette.

options?

ToGplOptions = {}

ToGplOptions.

Retourne

string

Exemples

Écrire une palette GIMP .gpl

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

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

Avec un nom de palette personnalisé

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

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