<?xml version="1.0"?>

<animation width="84" height="84">

<behaviour id="fade" algorithm="move" event="fade.end">
  <param name="from" value ="0.01"/>
  <param name="to" value="0.95"/>
  <param name="duration" value="3.0"/>
</behaviour>

<define id="ball">
 <transform type="scale">
	<param name = "x" value = "0.01"/>
	<param name = "y" value = "0.01"/>
	<animate param = "x" behaviour = "fade"/>
 	<animate param = "y" behaviour = "fade"/>
 <style type="RGBAColor">
  <param name="color" value = "FFFFFF"/>
  <param name="alpha" value = "0.95"/>
  <transform type="translate">
	  <param name="translation" value="(20,55)" />
	     <style type="font">
		  <param name="font" value="Helvetica-BOLD-36" />
				<primitive id = "number" type="text">
				<param name="text" value = " "/>
			</primitive>
		  </style>
  </transform>
  <transform type="translate">
      <param name="translation" value="(42,42)" />
	  <style id = "ballcolor" type="RGBAColor">
	        <param name="alpha" value = "0.95"/>
		<primitive type="circle">
		   <param name="radius" value="39" />
		</primitive>
	   </style>
	   <primitive type="circle">
	      <param name="radius" value="40" />
	   </primitive>
  </transform>
 </style>
    </transform>
</define>

<draw>
    <paste object="ball" /> 
</draw>

<forall var="i" values = "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49" >
	<command name="${i}">
	  <announce event = "~end"/>
          <set object="ballcolor" param="red"   value="(${i}.0/50.0)"/>
	  <set object="ballcolor" param="green" value="(1.0 - ${i}.0/50.0)"/>
	  <set object="ballcolor" param="blue"  value="(1.0 - ${i}/50.0)"/>
	  <set object="number" param="text" value="${i}"/>
	  <start behaviour="fade"/>
	</command>
</forall>

<command name = "reset">
   	  <reset behaviour="fade"/>
</command>

<event object="fade" event="fade.end">
  <announce event="end"/>
  <stop behaviour = "fade"/>
</event>

</animation>