Colors API

Generate Tailwind CSS-style color palettes from any color.

Endpoint

GET /:color

Returns a JSON palette with 11 shades (50-950) and a human-readable color name.

Accepted Formats

FormatExample
Hex (6-digit)ff5733 or %23ff5733
Hex (3-digit)f00 or %23f00
CSS namecoral, tomato, red
RGBrgb(255,87,51)
HSLhsl(14,100%25,60%25)

Example

curl https://colors.rodrigotome.es/ff5733
{
  "name": "Outrageous Orange",
  "shades": [
    { "name": "50",  "hexcode": "#fff3ed", "hsl": { "hue": 22, "saturation": 100, "lightness": 97 } },
    { "name": "100", "hexcode": "#ffe3d1", "hsl": { "hue": 25, "saturation": 100, "lightness": 91 } },
    ...
    { "name": "950", "hexcode": "#471405", "hsl": { "hue": 14, "saturation": 88,  "lightness": 15 } }
  ]
}

Error Response

// 400 Bad Request
{ "error": "Invalid color" }

// 404 Not Found
{ "error": "Not found" }

Resources