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.

37 lines 1.09 kB
import { Color } from "./Color"; import { validateComponent, validateStringProperty } from "./ValidationUtils"; export class ProcessColor extends Color { constructor(alpha, profile = null) { super(); this._alpha = validateComponent(alpha); this._profile = this._validateProfile(profile); } get alpha() { return this._alpha; } get profile() { return this._profile; } get isTransparent() { return this.alpha === 0; } equals(other) { if (!super.equals(other)) return false; const processOther = other; return this.profile === processOther.profile && this.alpha === processOther.alpha; } getData() { const data = super.getData(); data.profile = this.profile; data.alpha = this.alpha; return data; } _validateProfile(profile) { if (profile != null) return validateStringProperty(profile); return null; } } //# sourceMappingURL=ProcessColor.js.map