"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    ColorParser: ()=>ColorParser
});
const color_utils_cjs_namespaceObject = require("../../../../utils/color-utils.cjs");
class ColorParser {
    rgb() {
        return this.rgbString(this.red, this.green, this.blue);
    }
    rgbInverted() {
        return this.rgbString(255 - this.red, 255 - this.green, 255 - this.blue);
    }
    rgbSaturated() {
        const { h, s, v } = (0, color_utils_cjs_namespaceObject.rgbToHsv)(this.red, this.green, this.blue);
        let newSaturation = 2 * s;
        if (newSaturation > 1) newSaturation = 1;
        const { r, g, b } = (0, color_utils_cjs_namespaceObject.hsvToRgb)(h, newSaturation, v);
        return this.rgbString(r, g, b);
    }
    rgbString(r, g, b) {
        return `rgb(${r}, ${g}, ${b})`;
    }
    constructor(color){
        this.color = color;
        this.red = 255;
        this.green = 255;
        this.blue = 255;
        const rgb = this.color.match(ColorParser.REGEX);
        if (rgb) {
            this.red = parseInt(rgb[1], 10);
            this.green = parseInt(rgb[2], 10);
            this.blue = parseInt(rgb[3], 10);
        }
    }
}
ColorParser.REGEX = /\s*rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i;
exports.ColorParser = __webpack_exports__.ColorParser;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ColorParser"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
