I have an svg that has multiple paths inside that I want to manipulate the colours before drawing into the document:
In the SVG I have
<path id="pathHair01" ....
<path id="pathBody01" ....
<path id="pathMain01" ......
and IM loading this with
let img= new Image()
img.id = 'myImg'
img.src = 'myImage.svg'
before I draw using
ctx.drawImage(img, leftPoint, topPoint, newWidth, newHeight)
I want to manipulate the colours of my paths . g
How can I access the paths of .img before drawint it to the document?
(Ie I dont think I can use document.getElementById(img.id) since it hasnt yet been drawn to the document ?
New contributor
Paul is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.