Export to SVG 1.1 includes non-standard rgba colors
See original GitHub issuePreflight Checklist
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Describe the bug Export to SVG 1.1 includes non-standard rgba colors, when rgb colors would be more appropriate.
In SVG 1.1 colors are expressed as rgb values, while opacity is expressed in a separate attribute. In the candidate SVG 2.0 version, rgba colors are allowed. Usage of rgba color values are non-standard, even though many browsers support it, but browsers are not the only applications that read SVG images.
To Reproduce Steps to reproduce the behavior:
- Create a draw.io diagram, containing a rectangle.
- Export to SVG
- SVG file contains
rgba(*, *, *, 1)
color elements (* = wildcard).
Expected behavior
Minimum: Color values rgba(r, g, b, 1)
should be replaced with rgb(r, g, b)
.
In SVG 1.1, the alpha value should be moved to the attribute *-opacity
.
You may want to differentiate between SVG 1.1 and (future) SVG 2.0. In SVG 2.0 the existing behavior is fine (perhaps desired).
draw.io version (In the Help->About menu of the draw.io editor):
- draw.io version 15.8.6
Desktop (please complete the following information):
- OS: macOS
- Browser Safari
- Version 15.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
The next release will use rgb() values.
No, it does not work.
My current workaround is to run the SVG through
sed
(BSD syntax here):