sets up js case statement to check color