Skip to content

pantoken / design/swatches/src / toGpl

関数: toGpl()

toGpl(swatches, options?): string

実験的

スウォッチを GIMP の .gpl パレット文字列としてエンコードします。

パラメーター

swatches

読み取り専用 Swatch[]

パレット。

options?

ToGplOptions = {}

ToGplOptions.

戻り値

string

GIMP の .gpl パレットを書き出す

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

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

カスタムのパレット名を指定

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

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