document.querySelector('canvas').style.background = '#f0f0f0'; const origCtx = document.querySelector('canvas').getContext('2d'); const origStroke = origCtx.stroke; origCtx.stroke = function() { origCtx.strokeStyle = '#ff6600'; origStroke.apply(origCtx, arguments); };