You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's the alert I got with the fileReader API via console.
It would be nice if there was a way built in to reset the array with a pre-existing one.
Version: v1.8.2
Used bundle (es5 or normal one): normal
Used theme (default is classic): classic
Browser-version: Version 96.0.4664.45 Chrome
Operating-system: Windows 10
The text was updated successfully, but these errors were encountered:
This plugin won't get any feature anymore and it won't get any update after the end of 2021.
btw, I do not know if I understood exactly what you meant, Have you seen this? #241
With the codes he provided + loop you can easily delete every swatch then add predefined swatches.
something like this:
// Get SwatchesPickr.prototype.getSwatches=function(){returnthis._swatchColors.reduce((arr,swatch)=>{arr.push(swatch.color.toRGBA().toString(0));returnarr;},[]);};// Set SwatchesPickr.prototype.setSwatches=function(swatches){if(!swatches.length)return;for(leti=this._swatchColors.length-1;i>-1;i--){this.removeSwatch(i);}swatches.forEach(swatch=>this.addSwatch(swatch));};// Predefined SwatchesletdefaultSwatch=["rgba(244, 67, 54, 1)","rgba(233, 30, 99, 0.95)","rgba(156, 39, 176, 0.9)","rgba(103, 58, 183, 0.85)",];pickr.on("cancel",instance=>{// Remove all existing swatchesfor(letj=pickr.getSwatches().length;j>=0;j--){pickr.removeSwatch(j);}// Then add predefined swatchespickr.setSwatches(defaultSwatch);});
I have my swatches contained in a variable array.
Typically I would add a swatch to the array like so and re-apply the variable to be used again at a later time.
I would delete a swatch from the array like so and again re-apply the variable to be used again at a later time.
However all the documentation says is....
So I tried removing the swatch by finding the string and removing it that way.
It all works fine up until I allow the user to load in a project file to reset all the swatches to a new array.
When I run this code in console it runs perfectly fine but doesn't if I use the fileReader API.
Here's the code....
Here's the alert I got with the fileReader API via console.

It would be nice if there was a way built in to reset the array with a pre-existing one.
Version: v1.8.2
Used bundle (es5 or normal one): normal
Used theme (default is classic): classic
Browser-version: Version 96.0.4664.45 Chrome
Operating-system: Windows 10
The text was updated successfully, but these errors were encountered: