Describe the bug
When rendering SVGs with property fill="currentColor", it will take the foreground color from the graphics. And since JSVGRasterizer creates the graphics with BufferedImage.createGraphics(), and dont set the default foreground color, it will take it from its default which is always white. This causes all SVG icons which has fill="currentColor" to be white.
To Reproduce
Use an SVG with fill="currentColor".
Expected behavior
I would expect it to be black for light mode and white for dark mode. You can do this with g.setColor(color) after creating the graphics. (It wont override the fill="color") property when its specified, just the default when fill="currentColor", I have tested it already.
Environment:
- Select the platform(s) on which the behavior is seen:
-
Additional OS info (e.g. OS version, Linux Desktop, etc)
-
JRE/JDK version
25
Version since
Eclipse 4.40
Workaround (or) Additional context
This issue was introduced with this commit in the underlying Java SVG renderer: weisJ/jsvg@55c481e.
Describe the bug
When rendering SVGs with property fill="currentColor", it will take the foreground color from the graphics. And since JSVGRasterizer creates the graphics with BufferedImage.createGraphics(), and dont set the default foreground color, it will take it from its default which is always white. This causes all SVG icons which has fill="currentColor" to be white.
To Reproduce
Use an SVG with fill="currentColor".
Expected behavior
I would expect it to be black for light mode and white for dark mode. You can do this with g.setColor(color) after creating the graphics. (It wont override the fill="color") property when its specified, just the default when fill="currentColor", I have tested it already.
Environment:
Additional OS info (e.g. OS version, Linux Desktop, etc)
JRE/JDK version
25
Version since
Eclipse 4.40
Workaround (or) Additional context
This issue was introduced with this commit in the underlying Java SVG renderer: weisJ/jsvg@55c481e.