mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-10 20:20:46 -04:00
Implement argument reading for Gradient objects.
This commit is contained in:
parent
b9532f6a1a
commit
26efbdb451
3 changed files with 14 additions and 9 deletions
examples/JSON
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue