SVG created using JavaScript + opacity + color fidelity issue?
Hi there!
I'm creating SVGs in-browser using JavaScript. When I open them in Illustrator everything's black, unless I first convert the fill/stroke colors from HSL to Hex (which I'm now doing via script). For example:
<rect id="inDkSq0-27" x="0" y="0" width="6" height="6" transform="matrix(-0.22495,-0.97437,0.97437,-0.22495,335.66982,365.77399)" fill="hsl(50, 50%, 70%)" stroke="hsl(50, 50%, 70%)" fill-opacity="0.064" stroke-opacity="0.081"/>versus
<rect id="inDkSq0-27" x="0" y="0" width="6" height="6" transform="matrix(-0.22495,-0.97437,0.97437,-0.22495,335.66982,365.77399)"
fill="#ad1510" stroke="#7cb521" fill-opacity="0.064" stroke-opacity="0.081"/>I'm guessing that HSL isn't a kosher format for Illustrator? HSL is easier to deal with script-wise & I'd like to avoid unnecessary steps.
Secondly, when I do open the file successfully in Illustrator, the colors are shifted -- much more saturated and bright. Which is kinda cool, but I think may point to another issue with my opacity levels (see code above), and how it's translating from my code to Illustrator. Is that the case?
There are hundreds of elements in the SVG file: svg example on CodePen
Hope I'm asking my questions correctly -- thanks in advance for any insight!
Patrick
