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
I'm not sure if this is an issue or poor understanding by me:
When I use:
showSelectionPalette: true,
maxSelectionSize: 1,
It adds another palette colour after my original palette which is great.. however if I click back to one of the original palette colours it still shows the previous selection after the original palette list.
How do I hide the newly created colour (the one that wasn't in the original palette) if it is no longer active?
In simple terms - if its not active or in the original palette I don't want to see it.
Many thanks for such a great plugin
The text was updated successfully, but these errors were encountered:
The selection palette is designed to keep these colors around for quick reselection of previously used colors. I believe you could do something where on change you update the existing palette to include the currently selected color but only if it isn't in the palette in the first place.
Something like this probably (totally untested but this is the idea):
foo.spectrum({
palette: [['red'], []],
change: function(color) {
var palettes = $(this).spectrum("option", "palette");
// should probably check here first to make sure this color isn't in the palette already
palettes[palettes.length - 1] = [color.toHexString()];
$(this).spectrum("option", "palette", palette);
}
})
I'm not sure if this is an issue or poor understanding by me:
When I use:
showSelectionPalette: true,
maxSelectionSize: 1,
It adds another palette colour after my original palette which is great.. however if I click back to one of the original palette colours it still shows the previous selection after the original palette list.
How do I hide the newly created colour (the one that wasn't in the original palette) if it is no longer active?
In simple terms - if its not active or in the original palette I don't want to see it.
Many thanks for such a great plugin
The text was updated successfully, but these errors were encountered: