<!DOCTYPE html>
<html>
<canvas id='canvas' width=300 height=100></canvas>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 100, 100);
ctx.fillStyle = 'green';
ctx.fillRect(100, 0, 100, 100);
ctx.fillStyle = 'blue';
ctx.fillRect(200, 0, 100, 100);
</script>
</html>