The same color, four ways
Every format below encodes exactly the same orange. The differences are about ergonomics, not the pixels you see.
Which format should I use?
| Format | Looks like | Range | Alpha channel | Best when |
|---|---|---|---|---|
| HEX | #FF5733 | 6 hex digits (or 3-digit shorthand) | 8-digit #FF573380 | Storing static brand values, design tokens, copy-pasting between design tools and CSS |
| RGB / RGBA | rgb(255, 87, 51) | 0-255 per channel | rgba(…, 0.5) | JavaScript color math, canvas/pixel work, reading channel values directly |
| HSL / HSLA | hsl(11, 100%, 60%) | H 0-360, S/L 0-100% | hsla(…, 0.5) | Building tint/shade ramps, hover states, and harmonious palettes by hand |
| HSV / HSB | hsv(11, 80%, 100%) | H 0-360, S/V 0-100% | none in CSS | Artistic color mixing in editors like Photoshop and GIMP |
| CMYK | cmyk(0, 66, 80, 0) | 0-100% per channel | none | Print work — subtractive ink, not screen light |
| Which should I use? | — | — | — | HEX for values you store, HSL for values you calculate, CMYK only for print. |
The practical takeaway: pick HEX when a color never changes, and HSL the moment you need to derive one color from another. Everything else is a conversion detail the picker above handles for you.
Converting HEX to RGB by hand
HEX is just base-16 RGB. Split the six digits into three pairs and convert each pair to base-10:
FF→ (15 × 16) + 15 = 25557→ (5 × 16) + 7 = 8733→ (3 × 16) + 3 = 51
That gives rgb(255, 87, 51). A three-digit shorthand like #F53 expands by doubling each digit — #FF5533 — before you convert. Going the other direction, divide each channel by 16 to get the two hex digits. It is mechanical, which is exactly why a tool is faster than doing it in your head.
Accessibility: contrast is not optional
Picking a color that looks good is half the job; making sure people can read the text on it is the other half. WCAG expresses this as a contrast ratio between text and its background, running from 1:1 (invisible) to 21:1 (black on white). The thresholds that matter:
Note that contrast is about lightness difference, not hue — which is another reason HSL is handy. Two colors with the same hue but a wide gap in the L channel will usually pass, while two vivid but similarly-light colors can fail even though they look very different to a sighted user. The picker's built-in checker computes the exact ratio so you are not guessing.
Common use cases
- Design system tokens — define brand colors once and export them to HEX, RGB, and HSL so web, mobile, and print stay in sync.
- Hover and focus states — take a base HSL color and nudge the L value up or down for a consistent interaction ramp instead of hand-picking each shade.
- Palette generation — rotate the H channel by 30° for analogous colors or 180° for a complement, straight from color-theory principles.
- Accessibility audits — paste a text/background pair and confirm it clears the 4.5:1 bar before it ships.
Related developer tools
- QR Code Generator — create custom QR codes with brand colors and logos.
- Lorem Ipsum Generator — placeholder text for design mockups.
- View all developer tools — the full free suite for designers and developers.
Frequently asked questions
What is the difference between HEX, RGB, and HSL?
All three describe the same on-screen color with different numbers. HEX is a compact hexadecimal shorthand for RGB and is the CSS default. RGB lists Red, Green, and Blue from 0-255, matching how a screen emits light. HSL restates that color as Hue, Saturation, and Lightness, which is the easiest to adjust by hand.
When should I use HSL instead of RGB or HEX?
Use HSL whenever you need to change a color rather than just name it. Separate lightness and saturation axes let you darken a hover state, build a tint ramp, or rotate a hue for a palette without recomputing every channel.
How do I ensure good contrast?
Follow WCAG: normal text needs at least 4.5:1 (AA) and large text at least 3:1. For AAA, aim for 7:1 and 4.5:1 respectively. Use the accessibility checker in the tool above to measure any text/background pair exactly.
Need help with design systems?
Our design and development team can help implement consistent, accessible color systems and design tokens across your applications. Contact our design team.