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