paper.js/src/color/Gradient.js

17 lines
376 B
JavaScript
Raw Normal View History

var 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)
2011-03-03 12:29:40 -05:00
throw new Error('Gradient stop list needs to contain at least two stops.');
this._stops = stops;
}
2011-03-03 11:32:55 -05:00
});