You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When rendering radial gradients it seems that the library only renders the last color of that color stack.
Code
usingSystem.Text;usingSkiaSharp;varsvgText=""" <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500" height="250" viewBox="0 0 500 500"> <defs> <radialGradient fx="0" fy="0" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(351.936,-1.54852,-1.54852,-351.936,226.836,256.704)" spreadMethod="pad" id="radialGradient"> <stop style="stop-opacity:1;stop-color:#FF0000" offset="0" /> <stop style="stop-opacity:1;stop-color:#00FF00" offset="0.5" /> <stop style="stop-opacity:1;stop-color:#0000FF" offset="1" /> </radialGradient> </defs> <path d="m 0,167 v 14 h 1 v 7 h 1 v 6 h 1 v 6 h 1 v 3 h 1 v 4 h 1 v 3 h 1 v 4 h 1 v 3 h 1 v 3 h 1 v 2 h 1 v 3 h 1 v 2 h 1 v 3 h 1 v 2 h 1 v 2 h 1 v 2 h 1 v 2 h 1 v 2 h 1 v 2 h 1 v 2 h 1 v 1 h 1 v 2 h 1 v 2 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 2 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 2 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 1 v 1 h 2 v 1 h 1 v 1 h 2 v 1 h 1 v 1 h 1 v 1 h 2 v 1 h 1 v 1 h 1 v 1 h 2 v 1 h 2 v 1 h 1 v 1 h 2 v 1 h 2 v 1 h 1 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 2 v 1 h 3 v 1 h 2 v 1 h 3 v 1 h 3 v 1 h 3 v 1 h 3 v 1 h 3 v 1 h 4 v 1 h 4 v 1 h 4 v 1 h 7 v 1 h 7 v 1 h 39 v -1 h 6 v -1 h 7 v -1 h 4 v -1 h 4 v -1 h 4 v -1 h 4 v -1 h 2 v -1 h 3 v -1 h 3 v -1 h 3 v -1 h 3 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 1 v -1 h 2 v -1 h 2 v -1 h 2 v -1 h 1 v -1 h 2 v -1 h 1 v -1 h 2 v -1 h 1 v -1 h 1 v -1 h 2 v -1 h 1 v -1 h 1 v -1 h 2 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 2 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -2 h 1 v -1 h 1 v -1 h 1 v -1 h 1 v -2 h 1 v -1 h 1 v -1 h 1 v -2 h 1 v -1 h 1 v -1 h 1 v -2 h 1 v -1 h 1 v -2 h 1 v -2 h 1 v -1 h 1 v -2 h 1 v -1 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -2 h 1 v -3 h 1 v -2 h 1 v -3 h 1 v -3 h 1 v -2 h 1 v -4 h 1 v -3 h 1 v -4 h 1 v -4 h 1 v -5 h 1 v -6 h 1 v -6 h 1 v -11 h 1 v -5" style="fill:url(#radialGradient);" /> </svg> """;varsvgBytes=Encoding.UTF8.GetBytes(svgText);usingvarsvgStream=newMemoryStream(svgBytes);varsvg=newSkiaSharp.Extended.Svg.SKSvg(newSKSize(500,500));svg.Load(svgStream);usingvarbitmap=newSKBitmap(500,500);usingvarcanvas=newSKCanvas(bitmap);canvas.DrawPicture(svg.Picture);usingvaroutputStream=newFileStream("test.png",FileMode.Create);usingvarimage=SKImage.FromBitmap(bitmap);usingvardata=image.Encode(SKEncodedImageFormat.Png,100);data.SaveTo(outputStream);Console.WriteLine("Done!");
Expected Behavior
A PNG that with the same Colors as the SVG
Actual Behavior
A PNG that is just blue
Basic Information
Version with issue: SkiaSharp 2.88.8, SkiaSharp.Svg 1.60.0
Last known good version: /
IDE: VS Professional and VS Code
Platform Target Frameworks:
Windows Classic: Windows 11 Pro
Detailed IDE/OS information (click to expand)
PASTE ANY DETAILED VERSION INFO HERE
Screenshots
SVG:
Generated PNG:
Reproduction Link
The text was updated successfully, but these errors were encountered:
The SkiaSharp.Svg is no longer support or maintained. However, there is a far better library with almost full SVG support: https://github.com/wieslawsoltes/Svg.Skia
Description
When rendering radial gradients it seems that the library only renders the last color of that color stack.
Code
Expected Behavior
A PNG that with the same Colors as the SVG
Actual Behavior
A PNG that is just blue
Basic Information
Detailed IDE/OS information (click to expand)
Screenshots
SVG:
Generated PNG:
Reproduction Link
The text was updated successfully, but these errors were encountered: