import i from "chroma-js";
function generateRelatedNeutral(oklchColor, relationship = "same-hue") {
  try {
    const primaryColor = i(oklchColor);
    const hsl = primaryColor.hsl();
    const [h, s, l] = hsl;
    let neutralHue;
    let neutralSaturation;
    const neutralLightness = 45;
    switch (relationship) {
      case "same-hue":
        neutralHue = h;
        neutralSaturation = 0.05;
        break;
      case "analogous":
        neutralHue = (h + 60) % 360;
        neutralSaturation = 0.08;
        break;
      case "temperature": {
        const isWarmPrimary = h >= 30 && h <= 150;
        if (isWarmPrimary) {
          neutralHue = 210;
          neutralSaturation = 0.12;
        } else {
          neutralHue = 30;
          neutralSaturation = 0.12;
        }
        break;
      }
      case "complementary":
        neutralHue = (h + 180) % 360;
        neutralSaturation = 0.1;
        break;
      default:
        console.warn("Unknown relationship type, defaulting to same-hue");
        neutralHue = h;
        neutralSaturation = 0.05;
    }
    const neutralColor = i.hsl(neutralHue, neutralSaturation, neutralLightness / 100);
    return neutralColor.css("oklch");
  } catch (error) {
    console.warn("Error generating related neutral:", error);
    return "oklch(45% 0.02 240)";
  }
}
export {
  generateRelatedNeutral
};
//# sourceMappingURL=colors.js.map
