[Sugar-devel] xo colors & gradients

Walter Bender walter.bender at gmail.com
Mon Aug 23 15:14:07 EDT 2010


On Mon, Aug 23, 2010 at 1:52 PM, Erik Blankinship <erikb at mediamods.com> wrote:
> When I launch an activity, the SVG icon used to display my activity changes
> appearance by rendering with the XO colors.
> (1) Is there a way to render gradients using the fill color?  For example,
> if the child's XO fill color is red, I would like to render an activity icon
> using a red gradient.  Maybe there are tricks in SVG which make this
> possible?

SVG does have a gradient you can use. I use them in the Turtle Art
blocks. For example,

<defs>
    <linearGradient id="linearGradient1234">
        <stop style="stop-color:#ffffff;stop-opacity:1;" offset="0" />
        <stop style="stop-color:#000000;stop-opacity:1;" offset="1" />
    </linearGradient>
    <linearGradient
        xlink:href="#linearGradient1234"
        id="linearGradient5678"
        x1="0"
        y1="100 "
        x2="200"
        y2="300"
        gradientUnits="userSpaceOnUse" />
</defs>

later,

fill = "url(#linearGradient5678)"

-walter

> (2) Also, is there a way to override the XO colors and use different colors?
>  I know this is against UI guidelines, I am just wondering if it is
> possible.
> Thank you.
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list