mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Enhancement palettes : Added download palette
- palettes can be downloaded as GPL palettes - slightly tweaked the UI of hsl rgb picker - switched preferred format of spectrum to hex
This commit is contained in:
@ -149,7 +149,16 @@
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.downloadSelectedPalette_ = function () {
|
||||
window.alert('not implemented yet');
|
||||
// getSelectedPalette
|
||||
var paletteId = this.colorPaletteSelect_.value;
|
||||
var palette = this.paletteService.getPaletteById(paletteId);
|
||||
|
||||
var paletteWriter = new pskl.service.palette.PaletteGplWriter(palette);
|
||||
var paletteAsString = paletteWriter.write();
|
||||
|
||||
pskl.utils.BlobUtils.stringToBlob(paletteAsString, function(blob) {
|
||||
pskl.utils.FileUtils.downloadAsFile(blob, palette.name + '.gpl');
|
||||
}.bind(this), "application/json");
|
||||
};
|
||||
|
||||
ns.PalettesListController.prototype.onColorContainerContextMenu = function (event) {
|
||||
|
@ -20,7 +20,8 @@
|
||||
showInput: true,
|
||||
showButtons: false,
|
||||
move : this.setColor.bind(this),
|
||||
change : this.setColor.bind(this)
|
||||
change : this.setColor.bind(this),
|
||||
preferredFormat: 'hex'
|
||||
});
|
||||
|
||||
this.setColor("#000000");
|
||||
|
Reference in New Issue
Block a user