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