2013-02-10 22:38:35 -05:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2014-08-16 13:24:54 -04:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Gradients</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
2014-04-07 06:01:56 -04:00
|
|
|
<!-- IE 9: display inline SVG -->
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9">
|
2014-08-16 13:24:54 -04:00
|
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
|
|
<script type="text/paperscript" canvas="canvas">
|
|
|
|
var stops = [new Color(1, 1, 0, 0), 'red', 'black'];
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var radius = view.bounds.width * 0.4,
|
|
|
|
from = new Point(view.center.x),
|
|
|
|
to = from + [radius, 0];
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var circle = new Path.Circle({
|
|
|
|
center: from,
|
|
|
|
radius: radius,
|
|
|
|
fillColor: {
|
|
|
|
stops: stops,
|
|
|
|
radial: true,
|
|
|
|
origin: from,
|
|
|
|
destination: to
|
|
|
|
},
|
|
|
|
strokeColor: 'black'
|
|
|
|
});
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var from = view.bounds.leftCenter,
|
|
|
|
to = view.bounds.bottomRight;
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var rect = new Path.Rectangle({
|
|
|
|
from: from,
|
|
|
|
to: to,
|
|
|
|
fillColor: {
|
|
|
|
stops: stops,
|
|
|
|
radial: false,
|
|
|
|
origin: from,
|
|
|
|
destination: to
|
|
|
|
},
|
|
|
|
strokeColor: 'black'
|
|
|
|
});
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
rect.rotate(45).scale(0.7);
|
2013-02-12 20:22:31 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
document.body.appendChild(project.exportSVG());
|
|
|
|
</script>
|
2013-02-10 22:38:35 -05:00
|
|
|
</head>
|
2013-02-12 18:08:48 -05:00
|
|
|
<body>
|
2014-08-16 13:24:54 -04:00
|
|
|
<canvas id="canvas" width="300" height="600"></canvas>
|
2013-02-10 22:38:35 -05:00
|
|
|
</body>
|
2014-04-06 07:44:19 -04:00
|
|
|
</html>
|