const crypto = require("crypto");

const getLifecycleStatusColor = (key) => {
  const hash = crypto.createHash("sha256");
  hash.update(key);
  const hashedKey = hash.digest("hex");
  const num = parseInt(hashedKey, 16);
  return "#" + (num % 16777215).toString(16).padStart(6, "0");
};

module.exports = getLifecycleStatusColor;
