shape.js 376 B

1234567891011121314151617181920212223
  1. import Base from './base';
  2. class Shape extends Base {
  3. constructor(cfg) {
  4. super(cfg);
  5. this.names = ['shape'];
  6. this.type = 'shape';
  7. this.gradient = null;
  8. }
  9. /**
  10. * @override
  11. */
  12. getLinearValue(percent) {
  13. var values = this.values;
  14. var index = Math.round((values.length - 1) * percent);
  15. return values[index];
  16. }
  17. }
  18. export default Shape;