binarymax / floodfill.js

HTML5 Canvas Floodfill via JavaScript
MIT License
57 stars 14 forks source link

alpha channel not working for me #17

Open alejandroLoz opened 6 years ago

alejandroLoz commented 6 years ago

I'm trying to transform the background into transparent but it's not working for me: I've tried context.fillStyle = "rgba(0,0,0,0)"; but it fills the background with a non transparent color.

What should I do?

alejandroLoz commented 6 years ago

Checking the code if found this: color.a = Math.round((parseFloat(vals[3])||1.0)*255); So in case of setting vals[3] = 0.0 parseFloat(vals[3])||1.0) returns 1 which turns the alpha value to 255.