switch statement for colors and statement; copied from if_else_js.html