It's possible to do with the canvas plugin since as a basic requirement you need to be able to get and set pixels. The issue is the plugin doesn't have a direct way to erase pixels. Currently the only way to erase a pixel is to paste a 1x1 sprite with the destination out blend.
You'll have to do your own flood fill which is simple enough. Wikipedia has some useful info on how to do one.
The tolerance can be done with a 3d distance from color to color.
So a pixel is only flood filled if
Sqrt((255-r)^2 + (255-g)^2 + (255-b)^2) <= tolerance
There is a capx that does a simple flood fill with just events. It is rather slowish so it would be better if the whole bit was done with javascript for speed.
I haven't put much time aside as of late to make examples or tinker with much coding, so I can't help much furthur ATM.