Skip to content

Instantly share code, notes, and snippets.

@joeLepper
Last active December 14, 2015 19:19
Show Gist options
  • Save joeLepper/5136084 to your computer and use it in GitHub Desktop.
Save joeLepper/5136084 to your computer and use it in GitHub Desktop.
var rectangle = { x : 0
, y : 0
, w : 10
, h : 10
, color : '#ff9900' }
, drawRec = function(recObj, modifyColor) {
// do some canvas setup stuff, then set the fill color...
if (modifyColor === 'undefined'){
canvasContext.fillStyle = recObj.color;
}
else {
canvasContext.fillStyle = '#999999'
}
// draw some stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment