added RGB distance calculation. not so accurate