Originally Posted by rnd me
are you using context.beginPath() to reset the shape drawing?
No, I hadn't been. That was the problem causing the overlapping lines!
Lesson learned: always use cxt.beginPath();
And the issue with the multiple colors was just a syntax issue - I had forgotten to use quotations around the color names in my array.