fixed pickcolor function