Reimplemented the code for changing colors.