1.0.3 • Published 7 years ago

wi-palettify v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

palettify

Convert Palette files to RGBa json

Install

NPM:

npm install -g wi-palettify

Yarn

yarn add --save wi-palettify

Usage

const palettify = require('wi-palettify')
const path = require('path')

var dir = process.cwd();
palettify.extractToFile(path.join(dir, '/Palette/Earth.pal'), 'D://tmp/palette1.json', (err) => {
    if (err) {
        console.log(err);
    }
})

palettify.extractToFile(path.join(dir, '/Palette'), 'D://tmp/palette2.json', (err) => {
    if (err) {
        console.log(err);
    }
});

palettify.extractRaw(path.join(dir, '/Palette/Blue.pal'), (err, ret) => {
    if (err) {
        console.log(err);
    }else{
        console.log(ret);
    }
});

CLI

From the command line, cd to your chrome app folder and do:

palettify [options]

Options:

shortfulldescription
-h--helpoutput usage information
-V--versionoutput the version number
-r--require inputA palette file or folder
-o--outfile outfileWrite the data to this file