How to draw a rectangle with a gradient effect like the one shown below using an HTML5 canvas element?

Edit: Thanks for the feedback. Yes, I have already tried many methods. For example, is it possible to use the createRadialGradient method, as @Loktar suggests? Here is a sample code:
<html> <head> <title>test</title> <script type="application/x-javascript"> function draw() { var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"); var grad1 = ctx.createRadialGradient(50, 50, 0, 50, 50, 50); grad1.addColorStop(0, 'rgba(255, 252, 0, 1)'); grad1.addColorStop(1, 'rgba(68, 205, 37, 1)'); ctx.fillStyle = grad1; ctx.fillRect(0, 0, 100, 100); } </script> </head> <body onload="draw();"> <div> <canvas id="canvas" width="100" height="100"></canvas> </div> </body> </html>
But the result is not quite what I want:

This needs to be done easily using a method like PathGradientBrush provided by GDI +. I'm not sure if this is possible with an HTML5 canvas element.
source share