paper.js/examples/JSON/Gradients.html
Jürg Lehni bc2729683c Core: Renamed Symbol and PlacedSymbol classes and properties.
- Symbol -> SymbolDefinition
- PlacedSymbol -> SymbolItem
- Symbol#definition -> SymbolDefinition#item
- PlacedSymbol#symbol -> SymbolItem#definition
- Deprecate Project#symbols

Closes #770
2016-01-31 16:52:51 +01:00

34 lines
1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Gradients</title>
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript" src="../../dist/paper-full.js"></script>
<script type="text/paperscript" canvas="canvas1">
var path = new Path.Circle({
center: view.center,
radius: view.bounds.height * 0.4
});
path.fillColor = {
stops: ['yellow', 'red', 'black'],
radial: true,
origin: path.position,
destination: path.bounds.rightCenter
}
var symbol = new SymbolDefinition(path);
symbol.place(view.center);
window._json = project.exportJSON();
console.log(window._json);
</script>
<script type="text/paperscript" canvas="canvas2">
project.importJSON(window._json);
</script>
</head>
<body>
<canvas id="canvas1" width="500" height="500"></canvas>
<canvas id="canvas2" width="500" height="500"></canvas>
</body>
</html>