Skip to content

pantoken / design/swatches/src / toGpl

Função: toGpl()

toGpl(swatches, options?): string

Experimental

Codificar amostras como uma string de paleta GIMP .gpl.

Parâmetros

swatches

readonly Swatch[]

A paleta.

options?

ToGplOptions = {}

ToGplOptions.

Retorna

string

Exemplos

Escrever uma paleta GIMP .gpl

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

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

Com um nome de paleta personalizado

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

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