4 <canvas id=
"canvas" width=
"300" height=
"300"/>
6 var ctx
= document
.getElementById('canvas').getContext('2d');
8 var grad
= ctx
.createLinearGradient(150,0,150,300);
9 grad
.addColorStop(0, 'white');
10 grad
.addColorStop(1, 'black');
13 ctx
.fillRect(0,0,300,300);