Changing JS to a switch and color array