const require_to_rgba = require("../to-rgba/to-rgba.cjs");
//#region packages/@mantine/core/src/core/MantineProvider/color-functions/rgba/rgba.ts
function rgba(color, alpha) {
	if (typeof color !== "string" || alpha > 1 || alpha < 0) return "rgba(0, 0, 0, 1)";
	if (color.startsWith("var(")) return `color-mix(in srgb, ${color}, transparent ${(1 - alpha) * 100}%)`;
	if (color.startsWith("oklch")) {
		if (color.includes("/")) return color.replace(/\/\s*[\d.]+\s*\)/, `/ ${alpha})`);
		return color.replace(")", ` / ${alpha})`);
	}
	const { r, g, b } = require_to_rgba.toRgba(color);
	return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
const alpha = rgba;
//#endregion
exports.alpha = alpha;
exports.rgba = rgba;

//# sourceMappingURL=rgba.cjs.map