UNPKG

@aurigma/design-atoms-model

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

67 lines 2.49 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { Color } from "./Color"; import { validateComponent, validateStringProperty } from "./ValidationUtils"; var ProcessColor = /** @class */ (function (_super) { __extends(ProcessColor, _super); function ProcessColor(alpha, profile) { if (profile === void 0) { profile = null; } var _this = _super.call(this) || this; _this._alpha = validateComponent(alpha); _this._profile = _this._validateProfile(profile); return _this; } Object.defineProperty(ProcessColor.prototype, "alpha", { get: function () { return this._alpha; }, enumerable: true, configurable: true }); Object.defineProperty(ProcessColor.prototype, "profile", { get: function () { return this._profile; }, enumerable: true, configurable: true }); Object.defineProperty(ProcessColor.prototype, "isTransparent", { get: function () { return this.alpha === 0; }, enumerable: true, configurable: true }); ProcessColor.prototype.equals = function (other) { if (!_super.prototype.equals.call(this, other)) return false; var processOther = other; return this.profile === processOther.profile && this.alpha === processOther.alpha; }; ProcessColor.prototype.getData = function () { var data = _super.prototype.getData.call(this); data.profile = this.profile; data.alpha = this.alpha; return data; }; ProcessColor.prototype._validateProfile = function (profile) { if (profile != null) return validateStringProperty(profile); return null; }; return ProcessColor; }(Color)); export { ProcessColor }; //# sourceMappingURL=ProcessColor.js.map