paper.js/src/color/Gradient.js

20 lines
405 B
JavaScript
Raw Normal View History

var Gradient = this.Gradient = Base.extend({
initialize: function() {
this.stops = [
new GradientStop('white', 0),
new GradientStop('black', 1)];
this.type = 'linear';
},
getStops: function() {
return this._stops;
},
setStops: function(stops) {
2011-02-20 21:32:39 -05:00
if (stops.length < 2)
throw new Error(
'Gradient stop list needs to contain at least two stops.');
this._stops = stops;
}
2011-03-03 11:32:55 -05:00
});