HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var stage = acgraph.create("container");
2
3
var rectangle = stage.rect(0, 0, stage.width() / 3, stage.height() / 2);
4
5
// Creates linear gradient with angle preservation.
6
rectangle.fill(["0.4 #F44336", "0.6 #4CAF50"], 45, true);