improve color picking algorithm