import chalk, { Chalk } from "chalk";

//#region src/terminal/palette.ts
const SKYKOI_PALETTE = {
	accent: "#8B5CF6",
	accentBright: "#A78BFA",
	accentDim: "#6D28D9",
	info: "#C4B5FD",
	success: "#34D399",
	warn: "#FBBF24",
	error: "#F87171",
	muted: "#6B7280",
	auroraViolet: "#9333EA",
	auroraPink: "#DB2777",
	auroraBlue: "#3B82F6",
	auroraOrange: "#FF8C3C"
};

//#endregion
//#region src/terminal/theme.ts
const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env.FORCE_COLOR.trim().length > 0 && process.env.FORCE_COLOR.trim() !== "0";
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
const hex = (value) => baseChalk.hex(value);
const theme = {
	accent: hex(SKYKOI_PALETTE.accent),
	accentBright: hex(SKYKOI_PALETTE.accentBright),
	accentDim: hex(SKYKOI_PALETTE.accentDim),
	info: hex(SKYKOI_PALETTE.info),
	success: hex(SKYKOI_PALETTE.success),
	warn: hex(SKYKOI_PALETTE.warn),
	error: hex(SKYKOI_PALETTE.error),
	muted: hex(SKYKOI_PALETTE.muted),
	heading: baseChalk.bold.hex(SKYKOI_PALETTE.accent),
	command: hex(SKYKOI_PALETTE.accentBright),
	option: hex(SKYKOI_PALETTE.warn)
};
const isRich = () => Boolean(baseChalk.level > 0);
const colorize = (rich, color, value) => rich ? color(value) : value;

//#endregion
export { isRich as n, theme as r, colorize as t };