Shadow is used to apply shadow to shapes, images or text. Shadow takes some properties such as shadowOffsetX, shadowOffsetY, shadowBlur and shadowColor.
ShadowOffsetX property is used for horizontal distance (x-axis) between the shadow and shape. It creates horizontal shadow to shapes.
var variableName = canvas.getContext(2d);
variableName.shadowOffsetX=value;
ShadowColor property is used to apply color to shadow.
var variableName = canvas.getContext(2d);
variableName.shadowColor="color";
ShadowOffsetY property is used for vertical distance (y-axis) between the shadow and shape. It creates vertical shadow to shapes.
var variableName = canvas.getContext(2d);
variableName.shadowOffsetX=value;
ShadowBlur property is used to define blurness of shadow, shadow blur depends upon the blur value, higher the value, more blured the shape becomes, lower the value, the less blured the shape becomes. No blur is applied by using value as 0 (zero).
var variableName = canvas.getContext(2d);
variableName.shadowBlur=value;
You can apply shadow property to any of shape or image.
Open notepad or any other text editor, follow the following points.
save file with name task.html or task.htm and then open it using any browser and see results.