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 fillSettings = {
4
keys: [".1 red", ".5 green", ".9 blue"],
5
angle: -45,
6
mode: acgraph.math.Rect(150, 70, 100, 50),
7
opacity: .2
8
};
9
stage
10
.rect(0, 0, stage.width(), stage.height())
11
.fill(fillSettings);
12
fillSettings.opacity = 1;
13
stage.text(20, 3, "shape 1");
14
stage.rect(20, 20, 100, 70).fill(fillSettings);
15
stage.text(60, 125, "shape 2");
16
stage.rect(60, 140, 70, 50).fill(fillSettings);
17
stage.text(270, 73, "shape 3");
18
stage.rect(270, 93, 100, 100).fill(fillSettings);
19
stage.text(150, 53, "fill settings");
20
stage
21
.rect(150, 70, 100, 50).stroke("3 black")
22
.fill(fillSettings);