title: Painting Cells in Grid
body: <p>I have a JSfiddle set up here. I'm drawing a canvas grid and want to allow a user to select a color and 'paint' the grid cells like pixel art. Can someone point me in the right direction? </p>
  
  <p><a href="http://jsfiddle.net/g51bx1nb/" rel="nofollow">http://jsfiddle.net/g51bx1nb/</a></p>
  
  <pre><code>var c_canvas = document.getElementById("c");
  var context = c_canvas.getContext("2d");
  
  for (var x = 0.5; x &lt; 501; x += 20) {
  context.moveTo(x, 0);
  context.lineTo(x, 381);
  }
  
  for (var y = 0.5; y &lt; 381; y += 20) {
  context.moveTo(0, y);
  context.lineTo(500, y);
  }
  
  
  context.strokeStyle = "#ddd";
  context.stroke();
  </code></pre>