Generate a Procreate swatches file from a list of colors
$ npm install --save procreate-swatch-generator
var procreateSwatchGenerator = require('procreate-swatch-generator');
procreateSwatchGenerator(['#000', 'rgb(128, 128, 128)'], 'Goth Drab').pipe(fs.createWriteStream('./Goth Drab.swatches'));
//=> will write ./Goth Drab.swatches
$ npm install --global procreate-swatch-generator
$ procreate-swatch-generator --help
Usage
procreate-swatch-generator [...colors]
Example
procreate-swatch-generator '#000' 'rgb(128, 128, 128)'
// Writes ./My Awesome Swatch.swatches
procreate-swatch-generator '#000' 'rgb(128, 128, 128)' -f "$HOME/Dropbox/Goth Drab"
// Writes $HOME/Dropbox/Goth Drab.swatches
procreate-swatch-generator '#000' 'rgb(128, 128, 128)' -f 'Goth Drab' -o "$HOME/Dropbox"
// Writes ~/Dropbox/Goth Drab.swatches
// Also supports piping output to another process or destination
procreate-swatch-generator '#000' 'rgb(128, 128, 128)' -f 'Goth Drab' > './Goth Drab.swatches'
// Writes ~/Dropbox/Goth Drab.swatches
Options
-f, --filename Filename (without extension) of the swatch to use for the swatch. Autogenerated if not specified.
-o, --output Path of the directory where the swatch file will be written. Default: (inferred from the filename if not passed, or the the current directory otherwise).
procreateSwatchGenerator
returns a PassThrough stream object that can be piped to another destination.
Required
Type: Array
An array of valid color strings (hex, rgb(a), hsl(a), or hsv(a)). Any colors passed that use an alpha channel (such as rgba or hsla), will have the alpha channel dropped, since Procreate swatches don't consider the opacity of the colors (that can be set using the Layer Opacity tool).
Since Procreate's swatches only support up to 30 colors, any colors beyond 30 than that will be ignored (though I may add auto-splitting/creating of the swatches in a future release).
Required
Type: String
The name you wish to give to the swatch as it appears in Procreate.
MIT © Nate Cavanaugh