Gradient.js 352 B

123456789101112131415161718
  1. /**
  2. * @param {Array.<Object>} colorStops
  3. */
  4. var Gradient = function (colorStops) {
  5. this.colorStops = colorStops || [];
  6. };
  7. Gradient.prototype = {
  8. constructor: Gradient,
  9. addColorStop: function (offset, color) {
  10. this.colorStops.push({
  11. offset: offset,
  12. color: color
  13. });
  14. }
  15. };
  16. var _default = Gradient;
  17. module.exports = _default;