-
Notifications
You must be signed in to change notification settings - Fork 79
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
HEX/RGB colors are getting corrupted #402
Comments
Thank you for raising your first issue! Your help to improve svglib is much appreciated! |
Thanks for the report. Having a smallest possible sample to reproduce would be very appreciated! |
Please find a sample that reproduces the error:
|
Thanks for the procedure, I also thought about a SVG sample, if possible. |
I updated the example so that it saves the generated charts as SVG as well. |
Many thanks for the sample files. I was able to identify this issue as a bug in reportlab color converter (when any color in the
I don't know if the support of a rgb() syntax with values between 0 and 1 was something deliberate or not. I don't find any reference of such a syntax in the CSS specs. @replabrobin, would you be able to upstream that fix in reportlab, or would you like a post on the mailing list? |
I think the intention was to support the case where people used only 0-1 values for all rgba values. The assumption is then that these represent fractions of the whole range. Clearly not well thought out; blame me. Is there a soltution that's better. Probably we should check that all values are in the range [0, 1] before assuming the 255 factor. |
I guess that |
When using SVGlib to convert plotly SVG charts created using Kaleido.
Hex colors containing the value "01" are converted to "FF" causing the color to change from what it is originally in the SVG.
Example:
F57D01 (Orange) changes into F57DFF (Pink)
010063 (Dark Blue) changes into FF0063 (Pinkish red)
Using: Python 3.11.9, SVGlib 1.5.1, Reportlab 4.2.5, Plotly 5.24.1, Kaleido 0.1.0.post1
Thank you in advance for looking into it.
The text was updated successfully, but these errors were encountered: