Implement argument reading for Gradient objects.

This commit is contained in:
Jürg Lehni 2013-04-09 09:20:32 -07:00
parent b9532f6a1a
commit 26efbdb451
3 changed files with 14 additions and 9 deletions
examples/JSON

View file

@ -7,11 +7,11 @@
<script type="text/javascript" src="../../dist/paper.js"></script>
<script type="text/paperscript" canvas="canvas1">
var path = new Path.Circle(view.center, view.bounds.height * 0.4);
var gradient = new Gradient(['yellow', 'red', 'black'], true);
var from = path.position;
var to = path.bounds.rightCenter;
var gradientColor = new Color(gradient, from, to);
path.fillColor = gradientColor;
path.fillColor = {
gradient: [['yellow', 'red', 'black'], true],
origin: path.position,
destination: path.bounds.rightCenter
}
path.strokeColor = 'black';
window._json = project.exportJson();
console.log(window._json);