input metafun;
vardef shadowrect(expr dessin, vect,couleur) =
save im,i;
picture im;
im := image(
draw dessin;
);
draw im shifted vect withcolor couleur;
enddef;
vardef shadowblur(expr dessin, vect, couleur,pre,blur) =
save im,i,t;
picture im;
im := image(
draw dessin;
);
draw im shifted vect withcolor couleur;
for i:=pre downto 0:
for t:= 0 step 10 until 360:
draw im shifted (vect+blur*i/pre*(sind(t),cosd(t))) withcolor transparent(1,0.5,((0.05,0.05,0.05)+couleur+(i)/pre*white));
endfor;
endfor;
enddef;
vardef shadowdeg(expr dessin, vect,couleur,pre) =
save im,i;
picture im;
im := image(
draw dessin;
);
for i:=pre downto 0:
draw im shifted ((i/pre)*vect) withcolor transparent(1,(10/(pre)*(pre-i)/pre),couleur);
endfor;
enddef;