set()

Set the canvas background.

Syntax set(background)

Return Type Background

Description

Set the canvas background to the specified value.

Arguments

background : String
A valid string for setting a fill. See a detailed description in the fill property of display objects.

Return Value

Background. Returns the background module itself.

Examples

Example 1

We create a new core instance with a gray background. Then we add an event handler for the canvas, which will set the background to a blue color when clicked.

View Example
Code
var canvas = oCanvas.create({
	canvas: "#canvas",
	background: "#ccc"
});

canvas.bind("click tap", function () {
	canvas.background.set("#0ff");
});
Output