UNPKG

870 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var color_util_1 = require("@antv/color-util");
5var util_1 = require("@antv/util");
6var base_1 = require("./base");
7var Color = /** @class */ (function (_super) {
8 tslib_1.__extends(Color, _super);
9 function Color(cfg) {
10 var _this = _super.call(this, cfg) || this;
11 _this.type = 'color';
12 _this.names = ['color'];
13 if (util_1.isString(_this.values)) {
14 _this.linear = true;
15 }
16 _this.gradient = color_util_1.default.gradient(_this.values);
17 return _this;
18 }
19 /**
20 * @override
21 */
22 Color.prototype.getLinearValue = function (percent) {
23 return this.gradient(percent);
24 };
25 return Color;
26}(base_1.default));
27exports.default = Color;
28//# sourceMappingURL=color.js.map
\No newline at end of file