Color converter

HSL to RGB Converter

Convert hue, saturation, and lightness to RGB channels.

The returned RGB channels are rounded to integers from 0 to 255.

What this tool does

This conversion turns hue, saturation, and lightness into red, green, and blue sRGB channels. It is the numeric step used before a browser can render an HSL color as ordinary screen pixels.

Enter the values in the calculator above and choose Calculate. The calculation runs in your browser; the inputs are not intentionally sent to a Colormapped application server.

How it works

  1. Normalize hue to a 0–1 turn and percentages to 0–1.
  2. For zero saturation, use one gray value for all three channels.
  3. Otherwise derive the temporary p/q values from lightness and saturation.
  4. Sample the hue function for red, green, and blue, then round each channel to 0–255.

Worked example

Inputhsl(240 83% 65%)
Outputrgb(92, 92, 240)

The rounded HSL input resolves to equal red and green channels at 92 with a blue channel of 240.

When to use it

  • Convert an HSL CSS/design value into RGB data for graphics code.
  • Inspect the channel values produced by a hue or lightness adjustment.
  • Prepare a color for APIs that accept integer RGB channels.

Accuracy and limits

  • The returned channels are rounded to integers.
  • A rounded HSL value may not round-trip to the exact RGB color it originally came from.

Useful next steps