Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG -> XAML: Transparency #289

Open
PeterStefanicka opened this issue Jun 19, 2024 · 4 comments
Open

SVG -> XAML: Transparency #289

PeterStefanicka opened this issue Jun 19, 2024 · 4 comments
Assignees
Labels

Comments

@PeterStefanicka
Copy link

PeterStefanicka commented Jun 19, 2024

Hi, I have an issue when using SharpVectors for conversion of SVG file to XAML resource. Here you can see very simple SVG:

<svg id="test" data-name="test" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  <defs>
    <style>
      .cls-1 { fill: rgba(186, 208, 231, .5); stroke: #416596; stroke-linecap: round; stroke-linejoin: round; }
    </style>
  </defs>
  <rect class="cls-1" x="2.5" y="2.5" width="19" height="19"/>
</svg>

And here XAML result:

<ResourceDictionary xmlns="..." xmlns:x="..." xmlns:po="..." xmlns:mc="..." mc:Ignorable="po">
  <DrawingBrush x:Key="test" Stretch="Uniform" po:Freeze="true">
    <DrawingBrush.Drawing>
      <DrawingGroup>
        <DrawingGroup>
          <DrawingGroup.ClipGeometry>
            <RectangleGeometry Rect="0,0,24,24" />
          </DrawingGroup.ClipGeometry>
          <GeometryDrawing Brush="#00BAD0E7">
            <GeometryDrawing.Pen>
              <Pen Brush="#FF416596" Thickness="1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
            </GeometryDrawing.Pen>
            <GeometryDrawing.Geometry>
              <RectangleGeometry RadiusX="0" RadiusY="0" Rect="2.5,2.5,19,19" />
            </GeometryDrawing.Geometry>
          </GeometryDrawing>
        </DrawingGroup>
      </DrawingGroup>
    </DrawingBrush.Drawing>
  </DrawingBrush>
</ResourceDictionary>

If you compare those you see that: rgba(186, 208, 231, .5) does match Brush="#00BAD0E7" in R, G and B values but not A.

@paulushub paulushub self-assigned this Jun 19, 2024
@paulushub paulushub added the bug label Jun 22, 2024
paulushub added a commit that referenced this issue Jun 24, 2024
-  This resolves the issue #289
@paulushub
Copy link
Contributor

@PeterStefanicka Thanks for reporting. Please can you verify the latest commit for this issue?

@PeterStefanicka
Copy link
Author

@paulushub works well now, thanks a lot

@PeterStefanicka
Copy link
Author

@paulushub may i ask, when you plan next release where this fix will be included? thanks

@paulushub
Copy link
Contributor

@PeterStefanicka Sorry, will push a minor version this weekend. Was trying to fix other issues, but not successful yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants