Skip to content

Commit

Permalink
Check for degamma enabled before applying (#27) (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Jesper Grann Laursen <jgl@ipvision.dk>
  • Loading branch information
lauer and Jesper Grann Laursen committed Mar 27, 2022
1 parent c864b56 commit 2818b3d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/busylight.js
Expand Up @@ -164,9 +164,10 @@ Busylight.prototype.send = function(p){

if(p && p.color !== undefined) {
p.color = p.color || this._defaults.color;
this.buffer[positions.red] = degamma(p.color[0]);
this.buffer[positions.green] = degamma(p.color[1]);
this.buffer[positions.blue] = degamma(p.color[2]);
if (this.degamma || this._defaults.degamma) p.color = p.color.map(degamma)
this.buffer[positions.red] = p.color[0];
this.buffer[positions.green] = p.color[1];
this.buffer[positions.blue] = p.color[2];
}

if(p && p.tone === false)
Expand Down

0 comments on commit 2818b3d

Please sign in to comment.