import { TYPE as e } from "../constants.js";
import t from "./hex.js";
import n from "./hsl.js";
import r from "./keyword.js";
import i from "./rgb.js";
//#region ../../node_modules/khroma/dist/color/index.js
var a = {
	format: {
		keyword: r,
		hex: t,
		rgb: i,
		rgba: i,
		hsl: n,
		hsla: n
	},
	parse: (e) => {
		if (typeof e != "string") return e;
		let a = t.parse(e) || i.parse(e) || n.parse(e) || r.parse(e);
		if (a) return a;
		throw Error(`Unsupported color format: "${e}"`);
	},
	stringify: (r) => !r.changed && r.color ? r.color : r.type.is(e.HSL) || r.data.r === void 0 ? n.stringify(r) : r.a < 1 || !Number.isInteger(r.r) || !Number.isInteger(r.g) || !Number.isInteger(r.b) ? i.stringify(r) : t.stringify(r)
};
//#endregion
export { a as default };
