views:

31

answers:

2

i have an icon in the SVG format. i want to have it in different colors as favicon.
how to reach this?

since there isn't any toDataUrl() for SVG elements i don't see any solution without a server round trip.
i would even say that it isn't possible, but hopefully i'm wrong

any idea for a client side solution?
it doesn't need to be cross browser, one browser support would be nice enough :-)

+1  A: 

fabric.js supports rendering of SVG elements into canvas elements.

Ionuț G. Stan
A: 

This is not exactly what you asked, but here's a page testing the support for svg favicons in browsers.

If the browser supports svg as favicon it's trivial to generate a data url from the svg markup and use that. However, if you wanted a raster image (png, jpg) then yeah, look at the canvas solution. Some people even make games in the favicon...

Erik Dahlström
"If the browser supports svg as favicon it's trivial to generate a data url from the svg markup and use that" what do you mean?
brillout.com