You have one colour from a brand guide, say an orange #F97316, and you need five more: a darker version for a button's hover state, a very pale version for a highlighted panel, a muted one for borders, and something readable for text on white. Guessing new HEX codes by nudging digits rarely works, because HEX is written for computers, not for people adjusting colours by eye.
HSL is the format that makes this easy. This guide shows how HSL describes a colour, how to derive consistent lighter and darker variants from a single value, and where HSL's shortcuts break down. You will use a colour picker to get the starting numbers and plain CSS to apply the results.
Why HEX and RGB are awkward for adjustments
HEX and RGB both describe a colour as amounts of red, green and blue light, each from 0 to 255. #F97316 is simply rgb(249, 115, 22) written in base 16. To make that orange darker while keeping it recognisably the same orange, you would have to reduce all three channels in proportion, and to make it paler you would move all three towards 255 at different rates. It can be done, but nobody does it reliably in their head. For a full comparison of the formats, see HEX, RGB, HSL and CMYK colour codes explained.
How HSL describes a colour
HSL splits a colour into three separate controls:
- Hue (0 to 360 degrees) is the position on the colour wheel: 0 is red, 120 is green, 240 is blue. Our orange sits at about 25.
- Saturation (0 to 100%) is how vivid the colour is. At 0% any hue becomes a grey.
- Lightness (0 to 100%) runs from black at 0% through the pure colour around 50% to white at 100%.
Our example converts to hsl(25, 95%, 53%). Because hue is isolated in its own number, you can change lightness or saturation and the colour stays in the same family.
Get the HSL values with the colour picker
The Color Picker shows any colour in HEX, RGB and HSL at the same time.
- Open the Color Picker.
- Click the colour bar under the large swatch to open your device's colour chooser.
- Type your brand HEX value, choose from the spectrum, or use the eyedropper if your browser's chooser offers one (Chrome and Edge on desktop typically do).
- Read the three codes under the swatch. The HSL line is written in CSS form, such as
hsl(25, 95%, 53%). - Click the copy icon beside the HSL line and paste it into your stylesheet or notes.
The tool works with solid colours only, so there is no transparency value, and HSL numbers are rounded to whole degrees and percentages. That rounding can shift a colour by a hair, so keep the original HEX as the reference value for the brand colour itself.
Building a set of variants
Start from the base colour and change one number at a time.
| Purpose | HSL | Change from base |
|---|---|---|
| Base (brand) | hsl(25, 95%, 53%) |
none |
| Hover / pressed | hsl(25, 95%, 45%) |
lightness down 8 points |
| Text on white | hsl(25, 90%, 32%) |
much darker, slightly less saturated |
| Soft background | hsl(25, 95%, 94%) |
lightness near white |
| Border / divider | hsl(25, 40%, 80%) |
lighter and desaturated |
In CSS you can write these directly:
.button { background: hsl(25, 95%, 53%); }
.button:hover { background: hsl(25, 95%, 45%); }
.notice { background: hsl(25, 95%, 94%); color: hsl(25, 90%, 32%); }
Tints, shades and tones
Printers and painters use three words that map neatly onto HSL:
- A tint is the colour mixed with white: raise lightness.
- A shade is the colour mixed with black: lower lightness.
- A tone is the colour mixed with grey: lower saturation.
A consistent step, for example lightness at 95, 85, 75, 65, 53, 45, 35 and 25, gives you a tidy scale. The Color Shades Generator and the Tailwind Color Palette Generator build such scales automatically when you need all of them at once.
Where HSL falls short
HSL lightness is a mathematical midpoint, not a measure of how bright a colour looks to people. A yellow at 50% lightness appears far brighter than a blue at 50%. Two consequences follow:
- Equal lightness numbers do not mean equal contrast. Always check text and background pairs with a Color Contrast Checker. The rules behind the checker are covered in WCAG colour contrast ratio explained.
- Very dark or very light steps can drift. Dark shades of saturated colours sometimes look muddy. Pulling saturation down a little as you darken, as in the "text on white" row above, usually looks more natural.
Modern CSS also supports perceptual colour spaces such as OKLCH, where the lightness value tracks perceived brightness more closely. If your project targets current browsers and you need a large, even palette, it is worth reading up on. For quick hover states and backgrounds, HSL is still the simplest tool.
Other ways to find and adjust colours
- Design apps. Figma, Canva and most graphics editors show HEX and RGB, and many have an HSB or HSL mode with sliders. HSB (also called HSV) is similar to HSL but not identical: its "brightness" of 100% is the pure colour, not white, so don't copy numbers between the two.
- Operating system pickers. The macOS colour panel and the Windows colour dialog both let you pick and type values, but they are buried inside other apps.
- Browser developer tools. In Chrome, Edge and Firefox you can click a colour swatch in the Styles panel and cycle through formats. This is handy when you are already inspecting a page.
- From an image. To grab a colour from a photo or logo file rather than from your screen, use the Image Color Picker.
If you need to translate a value the other way, for example an HSL value from a design spec back into HEX, the Color Converter accepts typed input in any of the common formats.
Frequently asked questions
How do I make a colour darker in CSS?
Write it as hsl() and lower the lightness percentage while keeping hue and saturation the same. A drop of 5 to 10 points is typical for a hover or pressed state.
What is the difference between HSL and HSB?
Both use hue and saturation, but HSL's lightness goes from black to the pure colour to white, while HSB's brightness goes from black to the pure colour. The same colour has different numbers in each system.
Why does my lighter colour look washed out?
Raising lightness moves the colour towards white, which naturally reduces its vividness. Keep saturation high for tints you want to feel lively, and lower it for calm backgrounds.
Can I pick a colour from my screen?
Yes, if your browser's native colour chooser includes an eyedropper, which Chrome and Edge on Windows and macOS usually do. The picked value appears in all three formats straight away.
Does the colour picker support transparency?
No. It works with solid colours, so the output has no alpha channel. In CSS you can add transparency yourself, for example hsl(25 95% 53% / 0.5).