diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-03-01 01:13:36 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-03-01 01:17:36 +0100 |
commit | 52062f33177578a78803a1b675fdffdafe4f79d3 (patch) | |
tree | efd3d40e3fb1d9a291001bef0844e371fb0b37c3 /res/controllers/midi-components-0.0.js | |
parent | 5b846c5a34ff33bcf17e2ce56b8abf9c8c6ddf25 (diff) |
res/controllers/midi-components: Remove references to global color object
Diffstat (limited to 'res/controllers/midi-components-0.0.js')
-rw-r--r-- | res/controllers/midi-components-0.0.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index db2ac092f8..9936e0841e 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -308,12 +308,20 @@ shift: function() { this.inKey = "hotcue_" + this.number + "_clear"; }, - getColor: function() { - if (this.colorKey !== undefined) { - return color.colorFromHexCode(engine.getValue(this.group, this.colorKey)); - } else { - return null; + getColor: function(colorCode) { + if (colorCode === undefined && this.colorKey !== undefined) { + colorCode = engine.getValue(this.group, this.colorKey); } + + if (colorCode !== undefined) { + return { + "red": (colorCode >> 16) & 0xFF, + "green": (colorCode >> 8) & 0xFF, + "blue": colorCode & 0xFF, + }; + } + + return null; }, output: function(value) { var outval = this.outValueScale(value); @@ -336,7 +344,7 @@ print("ERROR: no function defined for sending RGB colors"); return; } - this.sendRGB(color.colorFromHexCode(colorCode)); + this.sendRGB(this.getColor(colorCode)); } }, connect: function() { |