Skip to content

pantoken-root / design/swatches/src / toGpl

Funció: toGpl() ​

toGpl(swatches, options?): string

Experimental

Codificar mostres com a una cadena de paleta GIMP .gpl.

Paràmetres ​

swatches ​

només de lectura Swatch[]

La paleta.

options? ​

ToGplOptions = {}

ToGplOptions.

Retorna ​

string

Exemples ​

Escriure una paleta GIMP .gpl

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

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

Amb un nom de paleta personalitzat

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

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