Learn Create Your Own Split Screen

Next Page

Now let's add some colour controls. We define a function that lets the colour be altered:
function SetColor(c) { ctx.strokeStyle= c; }
And we create a button to call the function
<button class=MySideButton style="background-color:red" onclick="SetColour('red')"> Red </button>

There's a few things to notice: