"use strict"; const GenColors = require("./GenColors-Di5GSft7.cjs"); const md5 = require("md5"); const _interopDefault = (e) => e && e.__esModule ? e : { default: e }; const md5__default = /* @__PURE__ */ _interopDefault(md5); const usernameToColor = function(username) { let hash = username.toLowerCase(); if (hash.match(/^([0-9a-f]{4}-?){8}$/) === null) { hash = md5__default.default(hash); } hash = hash.replace(/[^0-9a-f]/g, ""); const steps = 6; const finalPalette = GenColors.GenColors(steps); function hashToInt(hash2, maximum) { let finalInt = 0; const result = []; for (let i = 0; i < hash2.length; i++) { result.push(parseInt(hash2.charAt(i), 16) % 16); } for (const j in result) { finalInt += result[j]; } return parseInt(parseInt(finalInt, 10) % maximum, 10); } return finalPalette[hashToInt(hash, steps * 3)]; }; exports.usernameToColor = usernameToColor;