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
329 stars 96 forks source link

TSvgIconImageList wrong Color on android #251

Closed MrFillion closed 1 year ago

MrFillion commented 1 year ago

Hi First of all, tranks for this nice component. i think i found a bug with the TSVGImageList 3.9.4 (FMX version) using the img32 draw engine Im using Delphi 11.2 and its look like that the bug are not present in delphi 10.4.2 community

When you set a fill color for a path in the svg for the platform android (10,11,12,13) the RGB color are switched for BGR on android

This is a sample svg file

<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512">
  <path fill="#737373" d="M272 322.9c-.215-39.361.433-78.767-.329-118.1-4.116-21.357-36.324-12.45-30.808 7.893L240 322.9c-30.654 9.461-42.382 51.776-21.036 75.658 19.775 26.174 64.83 21.885 79.24-7.653 14.24-24.715 1.076-59.242-26.204-68.005zm96-44.4c-.206-58.37.42-116.762-.326-175.12C364.634 47.13 313.404-1.21 256.9 0c-58.69-1.144-112.468 50.173-112.862 109.109-.088 56.463-.013 112.927-.038 169.391-40.169 47.854-42.735 122.307-5.425 172.542 37.962 55.074 116.214 75.716 176.674 47.49 59.776-25.41 95.948-94.9 81.958-158.413-4.54-22.515-14.801-43.764-29.207-61.619zM256 448c-45.807 1.376-86.254-42.976-79.435-88.55-.996-25.292 23.51-41.33 31.435-60.167.163-63.777-.327-127.575.248-191.34 2.028-31.018 38.308-52.414 66.432-39.32 21.386 8.288 31.671 31.862 29.32 53.614V305.15c37.055 25.921 42.963 84.36 11.188 116.742-14.95 16.46-36.93 26.24-59.188 26.108z" />
  <path  fill="#FF0000" d="M248.677 415.188c-30.974-4.035-50.44-41.804-34.713-69.153 2.437-17.078 30.37-14.911 26.345-32.171.956-37.293-.678-74.841 2.183-111.969 13.282-23.384 36.73 2.165 29.21 21.17.186 33.432.214 66.864.33 100.295 30.763 9.654 42.138 52.615 19.74 75.894-10.488 12.524-27.09 18.045-43.095 15.934z"/>
</svg>

The red path (fill="#FF0000") are switched to blue only on android, i dont have tested this on ios yet But in window everything is ok

It is the normal ?

Many tanks for your support

carloBarazzetta commented 1 year ago

Please take a look at this: https://github.com/EtheaDev/SVGIconImageList/issues/229