linebender / resvg

An SVG rendering library.
Mozilla Public License 2.0
2.79k stars 225 forks source link

Support var when resolving colors #821

Open LaurenzV opened 1 month ago

LaurenzV commented 1 month ago

See here: https://developer.mozilla.org/en-US/docs/Web/CSS/var

Reason I want this is that the SVG OpenType spec allows reference CPAL palettes via vars. They way this should probably work is that the user can optionally provide a callback function that receives a string and then optionally returns a color.

LaurenzV commented 1 month ago

Thinking about it a bit more though, implementing this properly would probably require full-blown support for resolving variables in resvg (including its dependencies), so I guess this won't happen for a while...

RazrFalcon commented 1 month ago

This should be implemented in simplecss first. And yes, I have no plans on working on it. Or any other features to begin with. So patches are welcome.