{"size": 815, "ext": "js", "max_stars_repo_path": "dist/compliance/multiplyColor.js", "max_stars_repo_name": "LeighS95/WCAG-theme-generator", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/compliance/multiplyColor.js", "max_issues_repo_name": "LeighS95/WCAG-theme-generator", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/compliance/multiplyColor.js", "max_forks_repo_name": "LeighS95/WCAG-theme-generator", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 40.75, "max_line_length": 73, "alphanum_fraction": 0.6699386503}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.multiplyColor = void 0;
const tinycolor2_1 = __importDefault(require("tinycolor2"));
function multiplyColor(color, multiplier) {
    let hsvColor = (0, tinycolor2_1.default)(color).toHsv();
    let chroma = hsvColor.s * hsvColor.v;
    if (hsvColor.v === 0)
        hsvColor.v = (1 / 255);
    hsvColor.v = hsvColor * multiplier;
    hsvColor.v === 0 ? hsvColor.s = 0 : hsvColor.s = chroma / hsvColor.v;
    hsvColor.v = Math.min(1, hsvColor.v);
    hsvColor.s = Math.min(1, hsvColor.s);
    return (0, tinycolor2_1.default)(hsvColor).toHexString();
}
exports.multiplyColor = multiplyColor;
