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

SVGIconImage fixedColor inherited #132

Closed amancini closed 3 years ago

amancini commented 4 years ago

Hello ,

after change for add FixedColor to TSvgIconImage , by default you set clDefault that not apply custom color to SVG.

Is my opinion, by default use inherit color from the imagelist assigned to the TSVGIconIMage

i have edit SVGIconImage.pas

add new function

function TSVGIconImage.GetInheritedFixedColor: TColor;
begin
  Result := SVG_INHERIT_COLOR;
  if not Assigned(FImageList) then Exit;

  if FImageList is TSVGIconImageListBase then
    Result := TSVGIconImageListBase(FImageList).FixedColor;
end;

on paint event

    if FFixedColor <> SVG_INHERIT_COLOR then
      LSVG.FixedColor := FFixedColor
    else
      LSVG.FixedColor := GetInheritedFixedColor;

best regards

carloBarazzetta commented 3 years ago

Fixed in 2.2.1 version.