So what I'm trying to do is draw the outline of a body and fill it in with a user selected color. What I have right now is this initiation of shapes (the second one is iffy):
let shapes = [new Path2D('M 100 600 L 100 500 C 100 350 150 300 200 300 Q 225 295 225 250 C 150 200 150 50 250 50 ' +
'C 350 50 350 200 325 250 Q 320 255 300 255 Q 300 295 325 300 C 375 300 425 350 425 500 L 425 600'),
new Path2D('M 50 600 L 50 500 C 50 350 100 300 150 300 Q 210 295 210 250 C 135 200 135 50 235 50 ' +
'C 350 50 350 200 325 250 Q 320 255 300 255 Q 300 295 310 300 C 425 300 475 350 475 500 L 475 600')
this draw function:
function body(ctx, stroke, fill, shape) {
ctx.strokeStyle = stroke;
ctx.fillStyle = fill;
ctx.stroke(shapes[shape]);
ctx.fill(shapes[shape]);
}
and the body() function is called with the "fill" as a user-selected color, and the "shape" as a number. My problem is, making these paths with JavaScript or SVG (the paths are in SVG because that's less tedious than plain JS) is really tedious and involves a LOT of trial and error and refreshing. I want to make this as diverse as possible, with different face shapes and different sizes, but this method is draining and I don't think I have the attention span or motivation to do more than maybe 3 or 4 shapes this way. I can draw, though. And I can make transparent PNGs that are just the outline. Is there a way I could treat a PNG as a path or something so that I can draw the image on the canvas and then fill it with whatever color the user picked?