mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge pull request #460 from juliandescottes/issue458-colorformat
Issue #458: format selected color from spectrum as HexString
This commit is contained in:
commit
85eed8a2e2
@ -48,10 +48,18 @@
|
||||
*/
|
||||
ns.PaletteController.prototype.onPickerChange_ = function(evt, isPrimary) {
|
||||
var inputPicker = $(evt.target);
|
||||
var color = inputPicker.val();
|
||||
|
||||
if (color != Constants.TRANSPARENT_COLOR) {
|
||||
// Unless the color is TRANSPARENT_COLOR, format it to hexstring, as
|
||||
// expected by the rest of the application.
|
||||
color = window.tinycolor(color).toHexString();
|
||||
}
|
||||
|
||||
if (evt.data.isPrimary) {
|
||||
this.setPrimaryColor_(inputPicker.val());
|
||||
this.setPrimaryColor_(color);
|
||||
} else {
|
||||
this.setSecondaryColor_(inputPicker.val());
|
||||
this.setSecondaryColor_(color);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user