master
Dmitry Baranovskiy 2017-01-03 10:49:09 +11:00
parent 2e040ced8b
commit 4c93894571
4 changed files with 39 additions and 37 deletions

File diff suppressed because one or more lines are too long

13
dist/snap.svg.js vendored
View File

@ -7967,22 +7967,23 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
- opacity (number) #optional `0..1` opacity of the shadow
= (string) filter representation
> Usage
| var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
| var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
| c = paper.circle(10, 10, 10).attr({
| filter: f
| });
\*/
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
if (typeof blur == "string") {
if (opacity == null) {
if (color == null) {
opacity = blur;
blur = 4;
color = "#000";
} else {
color = blur;
opacity = color;
blur = 4;
}
if (typeof color != "string") {
opacity = color;
color = "#000";
}
color = color || "#000";
if (blur == null) {
blur = 4;
}

View File

@ -10781,7 +10781,7 @@ the classs presence or the value of the <code>flag</code> argument.
<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
c = paper.circle(10, 10, 10).attr({
filter: f
});</code></pre></section>
@ -10796,7 +10796,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.grayscale">
<header>
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 179 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L179">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 180 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L180">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.grayscale-extra"></div>
@ -10856,7 +10856,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.sepia">
<header>
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 206 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L206">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 207 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L207">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.sepia-extra"></div>
@ -10916,7 +10916,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.saturate">
<header>
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 234 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L234">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 235 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L235">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.saturate-extra"></div>
@ -10976,7 +10976,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.hueRotate">
<header>
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 254 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L254">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 255 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L255">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.hueRotate-extra"></div>
@ -11036,7 +11036,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.invert">
<header>
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 272 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L272">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 273 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L273">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.invert-extra"></div>
@ -11096,7 +11096,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.brightness">
<header>
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 294 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L294">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 295 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L295">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.brightness-extra"></div>
@ -11156,7 +11156,7 @@ the classs presence or the value of the <code>flag</code> argument.
<article id="Snap.filter.contrast">
<header>
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 314 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L314">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 315 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L315">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.contrast-extra"></div>

View File

@ -126,22 +126,23 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
- opacity (number) #optional `0..1` opacity of the shadow
= (string) filter representation
> Usage
| var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
| var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
| c = paper.circle(10, 10, 10).attr({
| filter: f
| });
\*/
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
if (typeof blur == "string") {
if (opacity == null) {
if (color == null) {
opacity = blur;
blur = 4;
color = "#000";
} else {
color = blur;
opacity = color;
blur = 4;
}
if (typeof color != "string") {
opacity = color;
color = "#000";
}
color = color || "#000";
if (blur == null) {
blur = 4;
}