gradient.js 458 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.parseGradient = void 0;
  4. /**
  5. * Parse heatmap gradient.
  6. */
  7. function parseGradient(gradient) {
  8. if (typeof gradient === 'string') {
  9. return gradient.split(' ').map((stop) => {
  10. const [r, c] = stop.split(':');
  11. return [+r, c];
  12. });
  13. }
  14. return gradient;
  15. }
  16. exports.parseGradient = parseGradient;
  17. //# sourceMappingURL=gradient.js.map