Preview:
                                
function drawLine( color, xInit, yInit, xEnd, yEnd, canvas)
{
    canvas.beginPath();
    canvas.strokeStyle=color;
    canvas.lineWidth=grosorLinea;
    canvas.moveTo(xInit, yInit);
    canvas.lineTo(xEnd, yEnd);
    canvas.stroke();
    canvas.closePath();
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter