EtheaDev / SVGIconImageList

Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)
Apache License 2.0
327 stars 96 forks source link

Add a new property to ISvg ApplyFixedColorToRootOnly #161

Closed pyscripter closed 3 years ago

pyscripter commented 3 years ago

Rational

With the FixedColor set you paint all elements with that color. But there are use cases in which you have some elements inheriting color from Root and others that specify their fill color and you only want to adjust the elements that inherit color from root. See for example.

image image

Notice how the outside shape adjusts its color but the colored elements do not.

This property will allow to style ajdust svgs with more than one color when the root color is the base and the elements that do not inherit that color stay as they are.

pyscripter commented 3 years ago

I have provided a PR that partially implements this issue. Partially since:

This property can now be applied only by accessing the SVG of SVGIconItems and setting it via the interface.

This property is meant to be set on an icon by icon basis.