"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OverlayColor = exports.OverlayColorEnums = void 0;
const core_1 = require("@vived/core");
var OverlayColorEnums;
(function (OverlayColorEnums) {
    OverlayColorEnums["GREEN"] = "Green";
    OverlayColorEnums["PINK"] = "Pink";
    OverlayColorEnums["YELLOW"] = "Yellow";
    OverlayColorEnums["RED"] = "Red";
    OverlayColorEnums["BLUE"] = "Blue";
    OverlayColorEnums["WHITE"] = "White";
    OverlayColorEnums["PURPLE"] = "Purple";
    OverlayColorEnums["BLACK"] = "Black";
    OverlayColorEnums["ORANGE"] = "Orange";
    OverlayColorEnums["NONE"] = "None";
})(OverlayColorEnums || (exports.OverlayColorEnums = OverlayColorEnums = {}));
class OverlayColor extends core_1.AppObjectEntity {
    static overlayColorEnumToColor(colorEnum) {
        return this.enumToColorLookup.get(colorEnum);
    }
    static addIfMissing(appObj) {
        const existing = appObj.getComponent(this.type);
        if (existing) {
            return existing;
        }
        else {
            return new OverlayColor(appObj);
        }
    }
    static get(appObj) {
        return appObj.getComponent(this.type);
    }
    static getByID(id, appObjects) {
        return appObjects.get(id)?.getComponent(this.type);
    }
    get overlayColor() {
        return this.memoizedColor.val;
    }
    set overlayColor(val) {
        this.memoizedColor.val = val;
    }
    constructor(appObject) {
        super(appObject, OverlayColor.type);
        this.memoizedColor = new core_1.MemoizedString(OverlayColorEnums.NONE, this.notifyOnChange);
    }
}
exports.OverlayColor = OverlayColor;
OverlayColor.type = "OVERLAY_COLOR";
OverlayColor.enumToColorLookup = new Map([
    [OverlayColorEnums.GREEN, core_1.Color.Hex("#008000")],
    [OverlayColorEnums.PINK, core_1.Color.Hex("#FFC0CB")],
    [OverlayColorEnums.YELLOW, core_1.Color.Hex("#FFFF00")],
    [OverlayColorEnums.RED, core_1.Color.Hex("#FF0000")],
    [OverlayColorEnums.BLUE, core_1.Color.Hex("#0000FF")],
    [OverlayColorEnums.WHITE, core_1.Color.Hex("#FFFFFF")],
    [OverlayColorEnums.PURPLE, core_1.Color.Hex("#800080")],
    [OverlayColorEnums.BLACK, core_1.Color.Hex("#000000")],
    [OverlayColorEnums.ORANGE, core_1.Color.Hex("#FFA500")],
]);
//# sourceMappingURL=OverlayColor.js.map