praeclarum / NGraphics

NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.
MIT License
706 stars 133 forks source link

Added support for specifying the brush to use for the default stroke/fill #58

Closed ahopper-soltech closed 5 years ago

ahopper-soltech commented 8 years ago

Hello! We found ourselves wanting the ability to specify which color to use when loading an SVG and no explicit stroke/fill colors are set. The changes here will continue to use Black as the brush if nothing is specified, but it does allow the user to indicate a color if they prefer a different default.

I've modified the test cases to use Green as the default brush, and it now causes the mozilla.ellipse and mozilla.Text2 and mozilla.Text3 test cases (which do not specify a color) to render as green.

praeclarum commented 7 years ago

Thank you. This looks good except for one thing:

I would prefer to expand the argument to be something like SvgReadOptions instead of just the dangling brush. I don't want to get into the case of having more than 2 arguments being passed around.

Would you mind adding that class and updating this PR?