Skip to content

Commit

Permalink
Fixed paint bucket fill color error (#1519)
Browse files Browse the repository at this point in the history
* fillColor getting correct color

* Fixed #1488

Corrected the multiplier from 256 to 255

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
  • Loading branch information
Olusamimaths and jywarren committed Jan 21, 2020
1 parent 2b3e5a2 commit 5b92ba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/PaintBucket/PaintBucket.js
Expand Up @@ -24,7 +24,7 @@ module.exports = exports = function(pixels, options) {
minFactor = (1 - tolerance / 100);
fillColor = fillColor.substring(fillColor.indexOf('(') + 1, fillColor.length - 1); // extract only the values from rgba(_,_,_,_)
fillColor = fillColor.split(',');
fillColor[3] = fillColor[3] * 255;
function isSimilar(currx, curry) {
return (pixels.get(currx, curry, 0) >= r * minFactor && pixels.get(currx, curry, 0) <= r * maxFactor &&
pixels.get(currx, curry, 1) >= g * minFactor && pixels.get(currx, curry, 1) <= g * maxFactor &&
Expand Down

0 comments on commit 5b92ba5

Please sign in to comment.