Issue #458: format selected color from spectrum as HexString

This commit is contained in:
Julian Descottes
2016-04-21 23:33:19 +02:00
parent cede7955dd
commit 78932048e8

View File

@@ -48,10 +48,18 @@
*/ */
ns.PaletteController.prototype.onPickerChange_ = function(evt, isPrimary) { ns.PaletteController.prototype.onPickerChange_ = function(evt, isPrimary) {
var inputPicker = $(evt.target); 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) { if (evt.data.isPrimary) {
this.setPrimaryColor_(inputPicker.val()); this.setPrimaryColor_(color);
} else { } else {
this.setSecondaryColor_(inputPicker.val()); this.setSecondaryColor_(color);
} }
}; };