updated colour picking algorithm