const PROJECT_COLORS = [
  { key: "blue", hex: "#3B82F6" },
  { key: "green", hex: "#22C55E" },
  { key: "purple", hex: "#A855F7" },
  { key: "red", hex: "#EF4444" },
  { key: "orange", hex: "#F97316" },
  { key: "yellow", hex: "#EAB308" },
  { key: "pink", hex: "#EC4899" },
  { key: "teal", hex: "#14B8A6" },
  { key: "indigo", hex: "#6366F1" },
  { key: "cyan", hex: "#06B6D4" },
  { key: "emerald", hex: "#10B981" },
  { key: "slate", hex: "#64748B" }
];
const PROJECT_COLOR_KEYS = PROJECT_COLORS.map((c) => c.key);
const COLOR_BY_KEY = new Map(PROJECT_COLORS.map((c) => [c.key, c.hex]));
function isProjectColorKey(value) {
  return typeof value === "string" && COLOR_BY_KEY.has(value);
}
function hashString(input) {
  let hash = 5381;
  for (let i = 0; i < input.length; i += 1) {
    hash = (hash << 5) + hash + input.charCodeAt(i) | 0;
  }
  return Math.abs(hash);
}
function autoColorFromName(name) {
  const safe = (name ?? "").trim().toLowerCase();
  const index = safe.length === 0 ? 0 : hashString(safe) % PROJECT_COLORS.length;
  return PROJECT_COLORS[index];
}
function resolveProjectColorHex(explicitKey, name) {
  if (isProjectColorKey(explicitKey)) return COLOR_BY_KEY.get(explicitKey);
  return autoColorFromName(name).hex;
}
export {
  PROJECT_COLORS,
  PROJECT_COLOR_KEYS,
  autoColorFromName,
  isProjectColorKey,
  resolveProjectColorHex
};
//# sourceMappingURL=colors.js.map
