From e109eaaa3e7cfc5dc92fd34aa669537434978790 Mon Sep 17 00:00:00 2001 From: Will Toohey Date: Mon, 21 Mar 2016 14:00:54 +1000 Subject: [PATCH] Invert spectrogram, missing semicolon --- src/js/HuesCore.js | 9 +++++++-- src/js/SoundManager.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/js/HuesCore.js b/src/js/HuesCore.js index 1abc204..39f2430 100644 --- a/src/js/HuesCore.js +++ b/src/js/HuesCore.js @@ -281,8 +281,13 @@ HuesCore.prototype.updateVisualiser = function() { this.vCtx.clearRect(0, 0, this.vCtx.canvas.width, this.vCtx.canvas.height); let gradient=this.vCtx.createLinearGradient(0,64,0,0); - gradient.addColorStop(1,"rgba(255,255,255,0.6)"); - gradient.addColorStop(0,"rgba(20,20,20,0.6)"); + if(this.invert) { + gradient.addColorStop(1,"rgba(20,20,20,0.6)"); + gradient.addColorStop(0,"rgba(255,255,255,0.6)"); + } else { + gradient.addColorStop(1,"rgba(255,255,255,0.6)"); + gradient.addColorStop(0,"rgba(20,20,20,0.6)"); + } this.vCtx.fillStyle = gradient; let barWidth = 2; diff --git a/src/js/SoundManager.js b/src/js/SoundManager.js index e5efd50..3fe2fdc 100644 --- a/src/js/SoundManager.js +++ b/src/js/SoundManager.js @@ -148,7 +148,7 @@ SoundManager.prototype.unlock = function() { window.addEventListener('click', unlocker, false); }); return this.lockedPromise; -} +}; SoundManager.prototype.playSong = function(song, playBuild, forcePlay) { let p = Promise.resolve();