Open any stylesheet or design tool and you will meet the same color written three different ways: a short code starting with #, a list of three numbers, and a triple built around a hue. They look like rival systems. They are not. HEX, RGB and HSL describe the same color three ways, and each description exists because it is good at a different job.

The Color Picker on Ovatly shows one color in all three notations at once, with a large preview. This guide explains what each notation actually says, when each earns its place, and the one precision catch: two of the three are always exact, and one is rounded.

Contents

  • Quick answer
  • One color, three descriptions
  • HEX: the compact code
  • RGB: the channel amounts
  • HSL: the one you adjust by eye
  • The precision asymmetry: two exact, one rounded
  • How to see all three at once, step by step
  • Worked example: one blue, adjusted by eye
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

HEX is a compact code for CSS. RGB lists red, green and blue amounts. HSL, which stands for hue, saturation and lightness, is the easiest to adjust by eye: keep the hue, then tune saturation and lightness. The Color Picker shows all three for one color, and the catch is precision: HEX and RGB are always exact, while its HSL values are rounded to whole numbers, so converting back can differ by one unit in a channel.

One color, three descriptions

A screen color is a specific mixture of light, and each notation is a way of writing that mixture down. The question is never which notation is correct. It is which description the job in front of you needs: storing it, reading its amounts, or adjusting it.

HEX: the compact code

HEX writes the color as a short code, the form CSS uses. A HEX color is 3 or 6 characters of 0-9 and A-F, optionally starting with #. Its strength is compactness: a whole color in six characters, easy to paste into a stylesheet, a config file or a message.

That compactness is also its limit: the code gives you no handle for "same color, a bit lighter". If a HEX color is slightly too dark, you either know the channel arithmetic or you switch notation, which is exactly what HSL is for.

RGB: the channel amounts

RGB lists red, green and blue amounts: how much of each channel the mixture contains. Where HEX compresses, RGB spells out. That makes RGB the notation to reach for when the amounts themselves are the information, for example when a format or a colleague asks for the channels separately rather than as one code.

RGB is exact, like HEX: the two are the same information at different compressions, and converting between them never loses anything.

HSL: the one you adjust by eye

HSL describes a color by hue, saturation and lightness. Hue is the color family: whether something reads as red, green or blue. Saturation is how intense or muted that hue is. Lightness is how light or dark the result is.

This is the easiest notation to adjust by eye, because its three numbers map onto the three judgements people naturally make about a color: what color is it, how strong is it, how light is it? To adjust a color in HSL, you keep the hue, so the color stays in the same family, then tune saturation and lightness until it looks right. Doing the same job in RGB means solving for three new channel amounts at once.

The precision asymmetry: two exact, one rounded

Here is the honest second half, specific to how the Color Picker presents HSL. HEX and RGB are always exact: the values shown are the values, digit for digit. The HSL values are rounded to whole numbers.

Rounding is harmless for reading and adjusting, which is what HSL is for. It matters only if you treat the HSL readout as a storage format. Convert a color to its rounded HSL, then convert back, and the result can differ by one unit in a channel from the original. One unit is invisible in almost every real situation, but it is a real difference, so the rule is simple: adjust in HSL if you like, then store and ship the finished color as HEX or RGB.

How to see all three at once, step by step

  1. Open the Color Picker and pick a color with the swatch, or type a HEX value like #2563EB.
  2. Read the HEX, RGB and HSL values in the result panel, next to the large preview.
  3. Copy the notation you need with its Copy button.
  4. Check the contrast ratios against black and white before using the color for text.

Worked example: one blue, adjusted by eye

The blue #2563EB is rgb(37, 99, 235) and hsl(221, 83%, 53%). The HEX is the one you would paste into a stylesheet. The RGB spells out the mixture: a little red, more green, blue at nearly full strength. The HSL tells the adjustment story: hue 221 places it in the blue family, saturation 83% says the hue is strong rather than muted, and lightness 53% puts it near the middle, with room to move either way.

Now adjust it by eye, in words. Hold the hue at 221, so the family cannot change. Lower the lightness and you get a deeper version of the blue, the kind you would reach for when the original is too bright behind white text. Raise it and you get a paler version, suited to backgrounds and tints. Lower the saturation instead and the blue greys down toward a muted tone, while hue and lightness stay where they were.

Notice that no new HEX code has been stated for any variant: the demonstration is the method, not a set of promised outputs. Make the change in the tool, then read and copy the exact HEX or RGB it shows. Its contrast shows why notation is not the whole job: 5.17:1 against white, passing the WCAG AA minimum of 4.5:1 for normal text, and 4.06:1 against black, which does not. The code describes the color; the ratio decides where it can work.

Limitations and honest tradeoffs

The HSL rounding described above is this tool's main precision caveat. The swatch is your operating system's picker, so it may offer extra formats, like CMYK for print, that this page does not display. And the notations describe screen colors: none of them promises that a printed result will match what the screen shows.

Common mistakes

  • Treating the three notations as three different colors. They are one color described three ways.
  • Storing a color as rounded HSL. Converting back can shift a channel by one unit. Store HEX or RGB.
  • Trying to adjust a color inside its HEX code. HEX has no adjustment handle. Switch to HSL, adjust, then read the new HEX.
  • Inventing the output code after an HSL change. Make the change in the tool and copy the real value it shows.
  • Typing a color name or an rgb() string where a HEX value is expected. HEX input is 3 or 6 characters of 0-9 and A-F, optionally starting with #.

FAQs

Are HEX, RGB and HSL different colors? No. They describe the same color three ways. The blue #2563EB is also rgb(37, 99, 235) and hsl(221, 83%, 53%). Nothing about the color changes when you switch notation; only the description changes.

Which notation is the most accurate? HEX and RGB are always exact. The HSL values in the Color Picker are rounded to whole numbers, so converting back from HSL can differ by one unit in a channel. When a value must be exact, copy HEX or RGB.

When should I use HSL instead of HEX? When you are adjusting a color by eye. In HSL you keep the hue, then tune saturation and lightness, which is far more intuitive than working out new red, green and blue amounts. For storing or shipping a finished color, HEX is the compact code CSS expects.

Why did my color shift slightly after I converted it through HSL? Because the HSL readout is rounded to whole numbers. The rounded hue, saturation and lightness describe a color that can sit one unit away in a channel from the original. It is a rounding effect, not an error, and it disappears if you copy the HEX or RGB value instead.

What makes a HEX value invalid? HEX colors are 3 or 6 characters of 0-9 and A-F, optionally starting with #. Color names and rgb() strings are not HEX values and are invalid as HEX input in the Color Picker.

Conclusion

HEX, RGB and HSL are one color wearing three descriptions: HEX for compact, exact storage in CSS, RGB for the channel amounts, and HSL for adjusting by eye, with the single caveat that HSL here is rounded, so exact values travel as HEX or RGB. To see how the notations get used when a real color catches your eye, read the sibling guide, How to Find the HEX Code of Any Color on Screen. For more guides in this series, see our Color and Design Tools guides.

References