Skip to content

pantoken-root / design/swatches/src / toGpl

Fonction: toGpl() ​

toGpl(swatches, options?): string

Expérimental

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

Paramètres ​

swatches ​

lecture seule Swatch[]

La palette.

options? ​

ToGplOptions = {}

ToGplOptions.

Renvoie ​

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