Change lines 10 and 11 above to this:
I think that does it.
1 2 | if (Math.abs(tint-( 255 -lightness)*darkness/ 255 ) < 8 ) return ; tint = ( 255 -lightness)*darkness/ 255 ; |