Skip to content

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