"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const getInitials = require("../get-initials/get-initials.cjs");
function hashCode(input) {
  let hash = 0;
  for (let i = 0; i < input.length; i += 1) {
    const char = input.charCodeAt(i);
    hash = (hash << 5) - hash + char;
    hash |= 0;
  }
  return hash;
}
const defaultColors = [
  "blue",
  "cyan",
  "grape",
  "green",
  "indigo",
  "lime",
  "orange",
  "pink",
  "red",
  "teal",
  "violet"
];
function getInitialsColor(name, colors = defaultColors) {
  const hash = hashCode(getInitials.getInitials(name));
  const index = Math.abs(hash) % colors.length;
  return colors[index];
}
exports.getInitialsColor = getInitialsColor;
