I am adding an SVG image to a black background in TMS WEB Core and would like to change the color of the SVG image to White. I have tried changing color in the properties but there is obviosly no color function due to the web image control not being a visual component but rather only the image linked to it.
The easiest way I have found to do this is by editing the path field to fill to another color of your choice in this case white. Here is an example:
procedure TMainForm.WebFormCreate(Sender: TObject);
var
SVGHome:String;
begin
SVGHome:= '<svg xmlns="http://www.w3.org/2000/svg" height="IconSize"viewBox="0 0 576 512"><!--FA--><path **fill="#FFFFFF"** d="M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c.2 35.5-28.5 64.3-64 64.3H128.1c-35.3 0-64-28.7-64-64V287.6H32c-18 0-32-1' +
'4-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7V64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32V185l52.8 46.4c8 7 12 15 11 24zM248 192c-13.3 0-24 10.7-24 24v80c0 13.3 10.7 24 24 24h' +
'80c13.3 0 24-10.7 24-24V216c0-13.3-10.7-24-24-24H248z"/></svg>';
HomeWIC.URL:= 'data:image/svg+xml;base64,' + window.btoa(SVGHome);
end;
The code written between asterisks(*) is not there on default and could be adjusted to any color
1