/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b859c78 | Cube Dev Team */
import { parseColor } from "../utils/styles.js";
import { convertColorChainToRgbChain } from "./createStyle.js";

//#region src/tasty/styles/color.ts
function colorStyle({ color }) {
	if (!color) return;
	if (color === true) color = "currentColor";
	if (typeof color === "string" && (color.startsWith("#") || color.startsWith("(#"))) color = parseColor(color).color || color;
	const match = color.match(/var\(--(.+?)-color/);
	let name = "";
	if (match) name = match[1];
	const styles = { color };
	if (name && name !== "current") Object.assign(styles, {
		"--current-color": color,
		"--current-color-rgb": convertColorChainToRgbChain(color)
	});
	return styles;
}
colorStyle.__lookupStyles = ["color"];

//#endregion
export { colorStyle };
//# sourceMappingURL=color.js.map