Instead of using window.floodfill, attach to context:
CanvasRenderingContext2D.prototype.floodfill = function(x, y, fillColor) {
floodfill(x, y, fillColor, this)
}
Allow fillcolor to be in other formats other than {r:255,g:0,b:0,a:1}: eg: "rgba(255,0,0,1)", [255,0,0,1], "red" (window.getComputedStyle can convert colors)
Change the order of the arguments, moving tolerance before width and height.
Since you can specify the width and height it should also allow you to specify a left and right. This would force the floodfill to be constrained to the given area.
It's an interesting suggestion, but I am usually not a fan of extending the prototype of native methods. Also, though I haven't stated it anywhere, I am actually planning on making this independent of a CanvasRenderingContext2D, and using UInt8ClampedArrays instead with an optional method for use of a context.
Good suggestion on the color. I will incorporate this
Argument order was already planned (to also include your last suggestion of allowing specificity of all boundaries). It will be a breaking change for 2.0.
Care to help with any of these and make a pull request? :)