createRadialGradient method

CanvasGradient createRadialGradient(
  1. num x0,
  2. num y0,
  3. num r0,
  4. num x1,
  5. num y1,
  6. num r1,
)

The CanvasRenderingContext2D.createRadialGradient() method of the Canvas 2D API creates a radial gradient using the size and coordinates of two circles.

This method returns a CanvasGradient. To be applied to a shape, the gradient must first be assigned to the CanvasRenderingContext2D.fillStyle or CanvasRenderingContext2D.strokeStyle properties.

Note: Gradient coordinates are global, i.e., relative to the current coordinate space. When applied to a shape, the coordinates are NOT relative to the shape's coordinates.

Implementation

external CanvasGradient createRadialGradient(
  num x0,
  num y0,
  num r0,
  num x1,
  num y1,
  num r1,
);