Added colours and restarted the line when mouse leaves canvas

the line connected from where the mouse left the canvas and rejoined.
Also added a basic colour palette.