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
321 stars 93 forks source link

Color problem with Android Demo #186

Closed carloBarazzetta closed 3 years ago

carloBarazzetta commented 3 years ago

In the SVGIconImageListDemoFMX, when compiled in Windows 64bit the icon colors are correct, but compiling in Android 64bit the color are not correct. image The conversion from TAlphaColor to TColor32 is made by this function:

function AlphaColor32(AlphaColor: TAlphaColor): TColor32;
var
  res: TARGB;
begin
  res.A := TAlphaColorRec(AlphaColor).A;
  res.R := TAlphaColorRec(AlphaColor).R;
  res.G := TAlphaColorRec(AlphaColor).G;
  res.B := TAlphaColorRec(AlphaColor).B;
  Result := res.Color;
end;

Why the conversion made from Adroid is different?

AngusJohnson commented 3 years ago

I suspect that the problem reported here is not Image32 related because I've just discovered significant issues with the Image32 SVG code that will prevent it compiling in FMX. (The rest of the Image32 library compiles without problems with FMX but evidently I've got quite a bit of work to do to make the SVG code FMX compatible.)

AngusJohnson commented 3 years ago

I've just now uploaded various bugfixes to Image32 that address these FMX cross-platform issues. https://sourceforge.net/p/image32/code/ci/master/tree/source/ Screenshot_20210717-125034

carloBarazzetta commented 3 years ago

Great Job! Thank you very much! I've fixed my code of AlphaColor32 adding: {$IFDEF ANDROID} Result := SwapRedBlue(Result); {$ENDIF}