I'm currently using Canvas to draw some curved lines
I know how to draw colored lines, but I don't find a way to render them with only a colored border..
For example :
const canvas = document.getElementsByTagName('canvas')[0],
ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(20, 20);
ctx.quadraticCurveTo(100, 10, 150, 75);
ctx.quadraticCurveTo(200, 140, 300, 100);
// this draws a 20px thick red line
ctx.lineCap = 'round';
ctx.lineWidth = 20;
ctx.strokeStyle = '#f00';
ctx.stroke();
<canvas width="350" height="150" style="border: 1px #303030 solid"></canvas>
I tried with clip(), but it's not built to cut a line...
Is there a way to draw a real border around a thick line, to avoid filling it ?
I don't want to re-draw a thinner colored line over it, because I'm using a transparent canvas within a parent DOM element filled with an image (and don't want to move this background into the canvas)