Updating coloring script, default window size 300

There were some bugs in the coloring script. Turned it into a state machine, that fixes it.