switch to function for color