Skip to content

pantoken-root / design/swatches/src / toGpl

Hàm: toGpl() ​

toGpl(swatches, options?): string

Thử nghiệm

Mã hóa các mẫu màu dưới dạng chuỗi bảng màu GIMP .gpl.

Tham số ​

swatches ​

chỉ đọc Swatch[]

Bảng màu.

options? ​

ToGplOptions = {}

ToGplOptions.

Trả về ​

string

Các ví dụ ​

Ghi một bảng màu GIMP .gpl

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

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

Với tên bảng màu tùy chỉnh

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

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