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