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