Edit in JSFiddle

var c=document.getElementById('myCanvas');
var ctx=c.getContext('2d');
//ctx.fillStyle='#FF0000';

  for (var x = 0, y = 0; x < 150 && y < 200; x += 50, y += 37) {
	var i = x+125;
	
	var color ='FF0'+i;
	//alert(color);
	ctx.fillStyle='#'+color;
	ctx.fillRect(x,y,60,60);
  }
<canvas id="myCanvas" style="border:1px solid #000000;">Your browser does not support the HTML5 canvas tag.</canvas>