-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packages/svg
can't understand RGB colors expressed in percentage
#1197
Comments
I have found the issue. It is in the Line 1155 in 7e77f89
It cannot understand decimal values in the percentage. If I use |
@erco77 has a patch here: memononen/nanosvg#136 (comment) I think it will work to solve this. |
Given that the upstream nanosvg maintainer is paying attention, I suggest the best thing to do is agree on a solution and put together a good PR upstream first. Once it is fixed there we can update our vendored version. If it was unmaintained or there was another roadblock I might consider patching locally, but in this case I don't see any reason this can't get fixed as far upstream as it possible. (Also keep a weather eye out on Rust crates that might make viable alternatives for SVG handling in the future.) |
@alerque memononen/nanosvg#136 is now closed by memononen/nanosvg#198 and just needs a release. However, NanoSVG has needed a release since April (memononen/nanosvg#197). If one isn't made soon hopefully using the development version is not such a big deal for SILE. |
No, I don't think using the HEAD version would be a problem for us. I'd rather they cut a release like they clearly need to, but we could deal with using anything on their default branch I suppose. cf. #1205 I'm pushing this to the next release cycle because "just one more thing" is already significantly delaying the math release and I want to get that cleaned up and out the door. |
I commonly use
cairosvg
on the command line to clean up SVG files I intend to put into SILE documents. One thing that it does that I need is it takes<use/>
elements and puts whatever is in the referent<symbol/>
there, while keeping track of transforms. (SILE cannot understand<use/>
at all.)Unfortunately,
cairosvg
also transforms color elements as part of its cleanup. It transformsfill:#4d4d4d
tofill:rgb(30.196078%,30.196078%,30.196078%)
. SILE interprets this as cyan, not the expected grey.Minimal example
These two SVG should be rendered equivalently:
box.svg
box2.svg
min.sil
Output
The text was updated successfully, but these errors were encountered: