szydlovski / procreate-swatches Goto Github PK
View Code? Open in Web Editor NEWread and create Procreate .swatches files
License: MIT License
read and create Procreate .swatches files
License: MIT License
Hey, thanks for this package :)
However i get issues when trying to open up the produced .swatches
files in Procreate, it just shuts down.
This is my code:
const swatchesFile = await createSwatchesFile(
`My palette`,
[
[[255, 255, 255], 'rgb'],
[[0, 0, 0], 'rgb']],
]
);
var blob = new Blob([swatchesFile], {
type: "application/zip;charset=binary"
});
FileSaver.saveAs(blob, 'my-palette.swatches');
I did additional testing with different formats, ex binarystring
and arraybuffer
but with the same result.
I compared with other downloadable .swatches
files that works to open with Procreate and they have a quite different format.
I extracted the .swatches
files as zip and looked at the contents of swatches.json
, and this is the differences i found:
Not working format - produced with this package:
{
"name": "My palette",
"swatches": [{
"hue": 0.13555555555555554,
"saturation": 0.3099173553719008,
"brightness": 0.9490196078431371,
"alpha": 1,
"colorSpace": 0
}, {
"hue": 0.13907284768211914,
"saturation": 0.592156862745098,
"brightness": 1,
"alpha": 1,
"colorSpace": 0
}]
}
Working format - downloaded from the web:
{
"name": "Figgy With It",
"swatches": [
{
"alpha": 1,
"origin": 2,
"colorSpace": 0,
"colorModel": 0,
"brightness": 0.92941176891326904,
"components": [
0.92941176891326904,
0.34509804844856262,
0.43137255311012268
],
"version": "5.0",
"colorProfile": "KzqhZFd5qeY0dE+vmwHpECsMm4j9bezteTTfhrlJr34=",
"saturation": 0.62869197486914274,
"hue": 0.97539150013656317
},
{
"alpha": 1,
"origin": 2,
"colorSpace": 0,
"colorModel": 0,
"brightness": 0.90980392694473267,
"components": [
0.90980392694473267,
0.18823529779911041,
0.33725491166114807
],
"version": "5.0",
"colorProfile": "KzqhZFd5qeY0dE+vmwHpECsMm4j9bezteTTfhrlJr34=",
"saturation": 0.79310344545199463,
"hue": 0.96557970883553024
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
],
"colorProfiles": [{
"colorSpace": 0,
"hash": "Kz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bgNwF3IrdEN2W3hze\r\not8p36\/gNuC94UThzOJT4tvjY+Pr5HPk\/OWE5g3mlucf56noMui86Ubp0Opb6uXrcOv77IbtEe2c\r\n7ijutO9A78zwWPDl8XLx\/\/KM8xnzp\/Q09ML1UPXe9m32+\/eK+Bn4qPk4+cf6V\/rn+3f8B\/yY\/Sn9\r\nuv5L\/tz\/bf\/\/",
"iccName": "sRGB IEC61966-2.1"
}]
}
Both files are shortened from the original version above.
So is it me doing something wrong or is the older format of swatches.json
outdated and no longer works for Procreate?
Any kind of input would be great,
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.