moved color function