Added a tolerance factor when comparing colors

I added a tolerance factor to fix #16. It is not ideal but it reduces the ugly contour of the painted area.

You can change the value of the tolerance var (line 466) to try it out. A control button would be necessary but as always, I'm a little bit too lazy to do it ;)