paper.js/src/color/GradientStop.js

42 lines
941 B
JavaScript
Raw Normal View History

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
*/
var GradientStop = this.GradientStop = Base.extend({
beans: true,
// TODO: support midPoint? (initial tests didn't look nice)
initialize: function(color, rampPoint) {
this.setColor(color);
this.setRampPoint(rampPoint);
},
getRampPoint: function() {
return this._rampPoint;
},
setRampPoint: function(rampPoint) {
this._rampPoint = rampPoint !== null ? rampPoint : 0;
},
getColor: function() {
return this._color;
},
setColor: function(color) {
this._color = Color.read(arguments);
}
2011-03-03 11:32:55 -05:00
});