aboutsummaryrefslogtreecommitdiff
path: root/js/panels/color/colorpanelbase.reel/colorpanelbase.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/color/colorpanelbase.reel/colorpanelbase.js')
-rwxr-xr-xjs/panels/color/colorpanelbase.reel/colorpanelbase.js32
1 files changed, 18 insertions, 14 deletions
diff --git a/js/panels/color/colorpanelbase.reel/colorpanelbase.js b/js/panels/color/colorpanelbase.reel/colorpanelbase.js
index 26d4932f..b3045db1 100755
--- a/js/panels/color/colorpanelbase.reel/colorpanelbase.js
+++ b/js/panels/color/colorpanelbase.reel/colorpanelbase.js
@@ -170,7 +170,7 @@ exports.ColorPanelBase = Montage.create(Component, {
170 this.addButton('current', this.btnCurrent); 170 this.addButton('current', this.btnCurrent);
171 this.addButton('previous', this.btnPrevious); 171 this.addButton('previous', this.btnPrevious);
172 // 172 //
173 this.addButton('hexinput', this.hextext); 173 this.addButton('hexinput', this.hextext, this.colorManager);
174 this.addButton('reset', this.btnDefault); 174 this.addButton('reset', this.btnDefault);
175 this.addButton('nocolor', this.btnNoColor); 175 this.addButton('nocolor', this.btnNoColor);
176 this.addButton('swap', this.btnSwap); 176 this.addButton('swap', this.btnSwap);
@@ -461,7 +461,7 @@ exports.ColorPanelBase = Montage.create(Component, {
461 //////////////////////////////////////////////////////////////////// 461 ////////////////////////////////////////////////////////////////////
462 // 462 //
463 addButton: { 463 addButton: {
464 value: function (type, button) { 464 value: function (type, button, manager) {
465 // 465 //
466 switch (type.toLocaleLowerCase()) { 466 switch (type.toLocaleLowerCase()) {
467 case 'chip': 467 case 'chip':
@@ -480,10 +480,14 @@ exports.ColorPanelBase = Montage.create(Component, {
480 } 480 }
481 if (c && c.css) { 481 if (c && c.css) {
482 this.ctx.clearRect(0, 0, this.cvs.width, this.cvs.height); 482 this.ctx.clearRect(0, 0, this.cvs.width, this.cvs.height);
483 this.style.backgroundColor = c.css; 483 if (m === 'gradient') {
484 this.style.backgroundImage = c.css;
485 } else {
486 this.style.backgroundColor = c.css;
487 }
484 } else { 488 } else {
485 this.drawNoColor(this, this.cvs); 489 this.drawNoColor(this, this.cvs);
486 } 490 }9
487 this.colorValue = c; 491 this.colorValue = c;
488 this.colorMode = m; 492 this.colorMode = m;
489 this.otherInput = false; 493 this.otherInput = false;
@@ -673,8 +677,8 @@ exports.ColorPanelBase = Montage.create(Component, {
673 case 'hexinput': 677 case 'hexinput':
674 var hexinp = HotText.create(); 678 var hexinp = HotText.create();
675 hexinp.element = button; 679 hexinp.element = button;
676 hexinp.labelFunction = this._updateHexValue.bind(this); 680 hexinp.labelFunction = this._updateHexValue.bind(manager);
677 hexinp.inputFunction = this._hottextHexInput.bind(this); 681 hexinp.inputFunction = this._hottextHexInput.bind(manager);
678 hexinp.needsDraw = true; 682 hexinp.needsDraw = true;
679 this._buttons.hexinput.push(hexinp); 683 this._buttons.hexinput.push(hexinp);
680 return hexinp; 684 return hexinp;
@@ -1244,23 +1248,23 @@ exports.ColorPanelBase = Montage.create(Component, {
1244 } 1248 }
1245 //Checking for panel mode and converting the color to the panel mode 1249 //Checking for panel mode and converting the color to the panel mode
1246 if (this._panelMode === 'hsl') { 1250 if (this._panelMode === 'hsl') {
1247 rgb = this.colorManager.hexToRgb(color); 1251 rgb = this.hexToRgb(color);
1248 if (rgb) { 1252 if (rgb) {
1249 update = this.colorManager.rgbToHsl(rgb.r, rgb.g, rgb.b); 1253 update = this.rgbToHsl(rgb.r, rgb.g, rgb.b);
1250 update.wasSetByCode = false; 1254 update.wasSetByCode = false;
1251 update.type = 'change'; 1255 update.type = 'change';
1252 this.colorManager.hsl = update; 1256 this.hsl = update;
1253 } else { 1257 } else {
1254 this.colorManager.applyNoColor(false); 1258 this.applyNoColor(false);
1255 } 1259 }
1256 } else { 1260 } else {
1257 update = this.colorManager.hexToRgb(color); 1261 update = this.hexToRgb(color);
1258 if (update) { 1262 if (update) {
1259 update.wasSetByCode = false; 1263 update.wasSetByCode = false;
1260 update.type = 'change'; 1264 update.type = 'change';
1261 this.colorManager.rgb = update; 1265 this.rgb = update;
1262 } else { 1266 } else {
1263 this.colorManager.applyNoColor(false); 1267 this.applyNoColor(false);
1264 } 1268 }
1265 } 1269 }
1266 } 1270 }
@@ -1269,7 +1273,7 @@ exports.ColorPanelBase = Montage.create(Component, {
1269 // 1273 //
1270 _updateHexValue: { 1274 _updateHexValue: {
1271 value: function (v) { 1275 value: function (v) {
1272 return this.colorManager.hex; 1276 return this.hex;
1273 } 1277 }
1274 }, 1278 },
1275 //////////////////////////////////////////////////////////////////// 1279 ////////////////////////////////////////////////////////////////////