All examples use BASE_URL — set it to your deployment URL.
POST/api/color/convert
Convert a color between HEX, RGB, and HSL formats.
const BASE_URL = "http://localhost:3000";
const res = await fetch(`${BASE_URL}/api/color/convert`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ color: "#6c63ff" })
// Also accepts: "rgb(108,99,255)" or "hsl(245,100,69)"
});
const data = await res.json();
// → { success: true, hex: "#6c63ff", rgb: "rgb(108, 99, 255)",
// hsl: "hsl(243, 100%, 69%)", r: 108, g: 99, b: 255 }