<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><br></blockquote><br><div class="gmail_quote">On Mon, Aug 23, 2010 at 3:14 PM, Walter Bender <span dir="ltr">&lt;<a href="mailto:walter.bender@gmail.com">walter.bender@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, Aug 23, 2010 at 1:52 PM, Erik Blankinship &lt;<a href="mailto:erikb@mediamods.com">erikb@mediamods.com</a>&gt; wrote:<br>

&gt; When I launch an activity, the SVG icon used to display my activity changes<br>
&gt; appearance by rendering with the XO colors.<br>
&gt; (1) Is there a way to render gradients using the fill color?  For example,<br>
&gt; if the child&#39;s XO fill color is red, I would like to render an activity icon<br>
&gt; using a red gradient.  Maybe there are tricks in SVG which make this<br>
&gt; possible?<br>
<br>
</div>SVG does have a gradient you can use. I use them in the Turtle Art<br>
blocks. For example,<br>
<br>
&lt;defs&gt;<br>
    &lt;linearGradient id=&quot;linearGradient1234&quot;&gt;<br>
        &lt;stop style=&quot;stop-color:#ffffff;stop-opacity:1;&quot; offset=&quot;0&quot; /&gt;<br>
        &lt;stop style=&quot;stop-color:#000000;stop-opacity:1;&quot; offset=&quot;1&quot; /&gt;<br>
    &lt;/linearGradient&gt;<br>
    &lt;linearGradient<br>
        xlink:href=&quot;#linearGradient1234&quot;<br>
        id=&quot;linearGradient5678&quot;<br>
        x1=&quot;0&quot;<br>
        y1=&quot;100 &quot;<br>
        x2=&quot;200&quot;<br>
        y2=&quot;300&quot;<br>
        gradientUnits=&quot;userSpaceOnUse&quot; /&gt;<br>
&lt;/defs&gt;<br>
<br>
later,<br>
<br>
fill = &quot;url(#linearGradient5678)&quot;<br><br></blockquote><div><br></div><div>Thank you, it is helpful to see how gradients can be used in SVG.  </div><div><br></div><div>How would I specify that I want to sugar to use the XO color to create a gradient from the XO fill color when my activity is running?  As I understand it, sugar activity icons can expect stroke_color and fill_color to be provided when an activity is launched:</div>
<div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div>&lt;!ENTITY stroke_color &quot;#010101&quot;&gt;</div></div><div class="gmail_quote">
<div>&lt;!ENTITY fill_color &quot;#FFFFFF&quot;&gt;</div><div><br></div></div></blockquote>Given one of these colors, it would like to calculate the stop-colors in your example.<div><br></div><div>Can I do this calculation in SVG?  Can my activity somehow pass this information to the SVG renderer when it is launched?</div>