Convert between hex, RGB, and HSL color formats with a single GET request. Includes automatic brightness detection for text contrast decisions.
Standard #RRGGBB hex notation
Individual R, G, B values (0-255)
Hue, saturation, lightness values
isLight boolean for contrast decisions
curl "https://api-snap.com/api/color?color=6366f1" \
-H "Authorization: Bearer snp_your_key"
# {"hex":"#6366f1","rgb":{"r":99,"g":102,"b":241},"hsl":{"h":239,"s":84,"l":67},"isLight":false}const res = await fetch(
"https://api-snap.com/api/color?color=rgb(255,107,107)",
{ headers: { Authorization: "Bearer snp_your_key" } }
);
const { hex, hsl, isLight } = await res.json();import requests
r = requests.get(
"https://api-snap.com/api/color",
params={"color": "#22c55e"},
headers={"Authorization": "Bearer snp_your_key"},
)
data = r.json()
print(f"RGB: {data['rgb']}, Light: {data['isLight']}")Convert user-selected colors between formats for CSS custom properties
Use isLight to automatically choose black or white text on colored backgrounds
Show hex, RGB, and HSL representations in color pickers and design apps
Convert between color spaces for chart libraries and gradient generation
Hex, RGB, HSL — all formats, one API call.
Get Your Free API Key