HTML and CSS Reference
In-Depth Information
// Add the color stops.
gr
.
addColorStop
(
0
,
'rgb(255,0,0)'
);
gr
.
addColorStop
(.
5
,
'rgb(0,255,0)'
);
gr
.
addColorStop
(
1
,
'rgb(255,0,0)'
);
// Use the gradient for the fillStyle.
context
.
fillStyle
=
gr
;
context
.
arc
(
100
,
100
,
100
, (
Math
.
PI
/
180
)
*
0
, (
Math
.
PI
/
180
)
*
360
,
false
false
);
context
.
fill
();
}