๐ฐgradients
browser โฉ canvas โฉ graphics state โฉ fill/stroke styles โฉ gradient
after creating CanvasGradient object, define gradient colors by calling CanvasGradient.addColorStop() (at least twice), parameters:
number๏ผ0 ~ 1
color๏ผcolors
The arguments to .createRadialGradient(): centers & radii of two circles:
need not be concentric.
first circle typically lies entirely inside the second.
areas inside smaller circle or outside the larger are filled with solid colors.
Gradient coordinates are relative to the drawing (2D) context, NOT relative to a shape's local coordinates.
Last updated
Was this helpful?