calculates the distance between two colours