[main.js] got color switching working correctly