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

add support for shadow colors in svg #2349

Merged
merged 1 commit into from
Jul 17, 2015
Merged

add support for shadow colors in svg #2349

merged 1 commit into from
Jul 17, 2015

Conversation

asturur
Copy link
Member

@asturur asturur commented Jul 17, 2015

closes #2098

canvas
image

exported svg
image

resulting svg

<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="700" height="600" xml:space="preserve"><desc>Created with Fabric.js 1.5.0</desc><defs></defs><filter id="SVGID_1" y="-80%" height="260%" x="-80%" width="260%" >
    <feGaussianBlur in="SourceAlpha" stdDeviation="10" ></feGaussianBlur>
    <feOffset dx="10" dy="10"  result="offsetBlur" ></feOffset>
    <feFlood flood-color="blue"/>
    <feComposite in2="offsetBlur" operator="in" />
    <feMerge>
        <feMergeNode></feMergeNode>
        <feMergeNode in="SourceGraphic"></feMergeNode>
    </feMerge>
</filter>
<rect x="-25" y="-25" rx="0" ry="0" width="50" height="50" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: red; fill-rule: nonzero; opacity: 1;filter: url(#SVGID_1);" transform="translate(179.75 179.75) scale(5.09 5.09)"/>
<filter id="SVGID_2" y="-45%" height="190%" x="-45%" width="190%" >
    <feGaussianBlur in="SourceAlpha" stdDeviation="5" ></feGaussianBlur>
    <feOffset dx="10" dy="10"  result="offsetBlur" ></feOffset>
    <feFlood flood-color="rgba(0,0,0,0.3)"/>
    <feComposite in2="offsetBlur" operator="in" />
    <feMerge>
        <feMergeNode></feMergeNode>
        <feMergeNode in="SourceGraphic"></feMergeNode>
    </feMerge>
</filter>
<circle cx="0" cy="0" r="40" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,255,0); fill-rule: nonzero; opacity: 0.5;filter: url(#SVGID_2);" transform="translate(437.5 91.5) "/>
</svg>

kangax added a commit that referenced this pull request Jul 17, 2015
add support for shadow colors in svg
@kangax kangax merged commit 4c915f1 into fabricjs:master Jul 17, 2015
@kangax
Copy link
Member

kangax commented Jul 17, 2015

👍

@asturur asturur deleted the shadowcolor-su branch July 17, 2015 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadow Color Support in SVG
2 participants