2011-03-06 19:50:44 -05:00
|
|
|
/*
|
|
|
|
* Paper.js
|
|
|
|
*
|
|
|
|
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
|
|
|
* based on Scriptographer.org and designed to be largely API compatible.
|
2011-03-07 20:41:50 -05:00
|
|
|
* http://paperjs.org/
|
2011-03-06 19:50:44 -05:00
|
|
|
* http://scriptographer.org/
|
|
|
|
*
|
2011-03-07 20:41:50 -05:00
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
2011-03-06 19:50:44 -05:00
|
|
|
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://lehni.org/ & http://jonathanpuckey.com/
|
|
|
|
*
|
2011-03-07 20:41:50 -05:00
|
|
|
* All rights reserved.
|
2011-03-06 19:50:44 -05:00
|
|
|
*/
|
|
|
|
|
2011-03-04 08:34:31 -05:00
|
|
|
var GradientStop = this.GradientStop = Base.extend({
|
2011-02-19 16:50:37 -05:00
|
|
|
beans: true,
|
|
|
|
|
|
|
|
// TODO: support midPoint? (initial tests didn't look nice)
|
|
|
|
initialize: function(color, rampPoint) {
|
2011-03-04 20:26:12 -05:00
|
|
|
this.setColor(color);
|
|
|
|
this.setRampPoint(rampPoint);
|
2011-02-19 16:50:37 -05:00
|
|
|
},
|
2011-03-03 17:45:17 -05:00
|
|
|
|
2011-02-19 16:50:37 -05:00
|
|
|
getRampPoint: function() {
|
|
|
|
return this._rampPoint;
|
|
|
|
},
|
2011-03-03 17:45:17 -05:00
|
|
|
|
2011-02-19 16:50:37 -05:00
|
|
|
setRampPoint: function(rampPoint) {
|
2011-03-04 20:26:12 -05:00
|
|
|
this._rampPoint = rampPoint !== null ? rampPoint : 0;
|
2011-02-19 16:50:37 -05:00
|
|
|
},
|
2011-03-03 17:45:17 -05:00
|
|
|
|
2011-02-19 16:50:37 -05:00
|
|
|
getColor: function() {
|
|
|
|
return this._color;
|
|
|
|
},
|
2011-03-03 17:45:17 -05:00
|
|
|
|
2011-03-08 12:17:36 -05:00
|
|
|
setColor: function(color) {
|
2011-02-19 16:50:37 -05:00
|
|
|
this._color = Color.read(arguments);
|
|
|
|
}
|
2011-03-03 11:32:55 -05:00
|
|
|
});
|