Note that there are some explanatory texts on larger screens.

plurals
  1. POSVG transparency with multiple gradients
    primarykey
    data
    text
    <p>I am trying to find out the optimal model for 4-way gradient filling. My latest model is <a href="http://jsfiddle.net/BfPZW/1/" rel="nofollow noreferrer">this</a> fiddle:</p> <pre><code>&lt;svg height="360" width="400" xmlns="http://www.w3.org/2000/svg" version="1.1"&gt; &lt;defs&gt; &lt;clipPath id="C"&gt; &lt;path d="M 100 200 L 300 58 L 400 250 L 300 341 Z" /&gt; &lt;/clipPath&gt; &lt;radialGradient id="G1" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"&gt; &lt;stop offset="0%" style="stop-color:rgb(255,0,0); stop-opacity:1" /&gt; &lt;stop offset="100%" style="stop-color:rgb(128,128,64); stop-opacity:0" /&gt; &lt;/radialGradient&gt; &lt;radialGradient id="G2" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"&gt; &lt;stop offset="0%" style="stop-color:rgb(0,255,0); stop-opacity:1" /&gt; &lt;stop offset="100%" style="stop-color:rgb(128,128,64); stop-opacity:0" /&gt; &lt;/radialGradient&gt; &lt;radialGradient id="G3" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"&gt; &lt;stop offset="0%" style="stop-color:rgb(0,0,255); stop-opacity:1" /&gt; &lt;stop offset="100%" style="stop-color:rgb(128,128,64); stop-opacity:0" /&gt; &lt;/radialGradient&gt; &lt;radialGradient id="G4" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"&gt; &lt;stop offset="0%" style="stop-color:rgb(255,255,0); stop-opacity:1" /&gt; &lt;stop offset="100%" style="stop-color:rgb(128,128,64); stop-opacity:0" /&gt; &lt;/radialGradient&gt; &lt;/defs&gt; &lt;ellipse cx="100" cy="200" rx="200" ry="200" clip-path="url(#C)" fill="url(#G1)" /&gt; &lt;ellipse cx="300" cy="58" rx="200" ry="200" clip-path="url(#C)" fill="url(#G2)" /&gt; &lt;ellipse cx="400" cy="250" rx="200" ry="200" clip-path="url(#C)" fill="url(#G3)" /&gt; &lt;ellipse cx="300" cy="341" rx="200" ry="200" clip-path="url(#C)" fill="url(#G4)" /&gt; &lt;/svg&gt; </code></pre> <p>which comes with result:</p> <p><img src="https://i.stack.imgur.com/LGx5m.png" alt="enter image description here"></p> <p>But when I change order of <code>&lt;ellipse&gt;</code> elements (see <a href="http://jsfiddle.net/dq9PH/1/" rel="nofollow noreferrer">this</a> fiddle):</p> <pre><code> &lt;ellipse cx="100" cy="200" rx="200" ry="200" clip-path="url(#C)" fill="url(#G1)" /&gt; &lt;ellipse cx="300" cy="58" rx="200" ry="200" clip-path="url(#C)" fill="url(#G2)" /&gt; &lt;ellipse cx="300" cy="341" rx="200" ry="200" clip-path="url(#C)" fill="url(#G4)" /&gt; &lt;ellipse cx="400" cy="250" rx="200" ry="200" clip-path="url(#C)" fill="url(#G3)" /&gt; </code></pre> <p>result changes to:</p> <p><img src="https://i.stack.imgur.com/ac1Dq.png" alt="enter image description here"></p> <p>Which means transparency is not calculated same way. I would like to have transparency calculated always with same results, regardless of order of the elements. What is a solution for this issue?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload