AiLounge Tools

Color & CSS Style Tools

Convert HEX/RGB/HSL, compute WCAG contrast, and generate controlled gradient and box-shadow CSS entirely in your browser. No uploads.Processed locally · no uploads

HEX / RGB / HSL colour conversion

Enter an sRGB HEX, rgb()/rgba() or hsl()/hsla() value and get all three formats at once; error tolerances are public and asserted by tests.

Run in browser

Inputs and parameters

Real example

color=#176b50, target=all
→ HEX #176b50 → RGB rgb(23, 107, 80) → HSL hsl(160.7, 64.6%, 25.5%)

Limits and failure handling

sRGB only; no CSS colour names, Lab/LCH, CMYK, wide-gamut spaces or image eyedropper. HSL output keeps one decimal; see the documented tolerances. Invalid input stays in the form with a readable error.

FAQ

Can I type a colour name like red?

No. Only HEX, rgb()/rgba() and hsl()/hsla() literals are accepted; unknown formats produce an explicit Unsupported color error.

How are alpha and rounding handled?

3/4/6/8-digit HEX and rgba()/hsla() alpha (0..1) are supported; alpha is also printed. RGB channel error ≤1/255, hue ≤0.5°, s/l ≤0.5%.

What happens with out-of-range values?

Inputs such as rgb(256,0,0) or hsl(0,101%,50%) raise an explicit OUT_OF_RANGE error instead of being silently clamped.