Skip to content

pantoken-root / design/swatches/src / toGpl

Función: toGpl() ​

toGpl(swatches, options?): string

Experimental

Codificar las muestras como una cadena de paleta .gpl de GIMP.

Parámetros ​

swatches ​

solo lectura Swatch[]

La paleta.

options? ​

ToGplOptions = {}

ToGplOptions.

Devuelve ​

string

Ejemplos ​

Escribir una paleta .gpl de GIMP

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

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

Con un nombre de paleta personalizado

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

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