HEX, RGB, HSL, and CMYK: Exact Color Specs for Web and Print
Color systems · Updated 2026-11-24
Every brand style guide needs five color formats: HEX and RGB for screens, HSL or OKLCH for CSS design tokens, and CMYK for commercial printing. Knowing how each model converts prevents bright web blues and oranges from turning muddy on printed packaging.
What each color model actually measures
Screens emit light using additive red, green, and blue subpixels (RGB), while printing presses absorb light using subtractive cyan, magenta, yellow, and black inks (CMYK). Because light and ink operate in opposite directions, a screen can display vivid electric blues that physical ink on uncoated paper cannot reproduce.
HEX is simply RGB written in base-16 hexadecimal notation. A color like #1d4ed8 splits into three pairs: 1d equals 29 red, 4e equals 78 green, and d8 equals 216 blue on a 0 to 255 scale.
HSL (Hue, Saturation, Lightness) and OKLCH (Lightness, Chroma, Hue) express the same screen colors in coordinates humans can adjust predictably when generating hover states or dark-mode tints.
| Format | Scale | Primary use | Example (#1d4ed8) |
|---|---|---|---|
| HEX | #000000 to #ffffff | CSS, Figma, brand docs | #1D4ED8 |
| RGB | 0-255 per channel | Canvas, SVG, PDF sRGB | rgb(29, 78, 216) |
| HSL | H 0-360, S/L 0-100% | Legacy CSS tint adjustments | hsl(224, 76%, 48%) |
| OKLCH | L 0-1, C 0-0.4, H 0-360 | Perceptually uniform CSS ramps | oklch(0.488 0.217 264.4) |
| CMYK | 0-100% ink channels | Brochures, labels, business cards | 87, 64, 0, 15 |
How mathematical RGB to CMYK conversion works
Standard device conversion normalizes R, G, and B to 0 through 1, then computes the black key channel K as 1 minus the highest channel value. Cyan, magenta, and yellow are derived by subtracting each normalized channel and K, then dividing by 1 minus K.
Pure black (#000000) is a special case where K equals 1. Dividing by 1 minus K would produce division by zero unless handled explicitly as C=0, M=0, Y=0, K=100. For large printed dark areas, commercial printers often request a rich black mix such as 40, 30, 30, 100 rather than plain 0, 0, 0, 100.
Remember that mathematical sRGB-to-CMYK values are a fast starting specification. Commercial offset and digital presses rely on ICC profiles (such as GRACoL or FOGRA39) and paper coating, so always request a physical press proof before ordering 5,000 labels.
Why OKLCH beats HSL for building tonal color scales
In classic HSL, yellow at 50% lightness looks bright while blue at 50% lightness looks dark because HSL ignores human eye sensitivity. Generating a 100-to-900 color scale in HSL often creates uneven contrast steps across different hues.
OKLCH maps lightness perceptually using Bjorn Ottosson's OKLab color space. Two colors with the same OKLCH lightness L value read with almost identical visual brightness, making it far easier to swap a primary blue for a teal or burgundy without breaking button readability.
Including both HEX and OKLCH in your style guide lets modern CSS codebases adopt perceptually balanced scales while older tools continue reading standard 6-digit HEX strings.
Print production safeguards for brand palettes
Before locking a brand palette for packaging or stationery, check total ink coverage by adding C + M + Y + K percentages. Uncoated and kraft papers absorb heavy ink and smudge when total coverage rises above 260% to 280%.
Under standard commercial CMYK prepress baselines, export raster artwork at 300 DPI and include a 3 mm (metric) or 0.125 in (US) bleed margin on every edge where a brand color block touches the trim line. Vector PDFs keep solid color rectangles sharp at any print size.
- Always test body text colors in 100% black (K=100) for office laser print compatibility.
- Avoid ultra-saturated RGB cyans and neon greens when your business prints labels or uniforms.
- Document paper stock preference (coated matte vs. uncoated) right beside your CMYK table.
Worked example: converting #1d4ed8 step by step
Walking through one real conversion shows why automated brand engines prevent manual rounding mistakes. Start with #1d4ed8, which splits into R = 29, G = 78, and B = 216 on a 0 to 255 sRGB scale.
Divide each channel by 255 to get normalized decimals: R' = 0.1137, G' = 0.3059, and B' = 0.8471. The largest normalized value is blue at 0.8471, so black key ink K = 1 - 0.8471 = 0.1529, which rounds to 15%.
Next compute cyan as (1 - 0.1137 - 0.1529) / (1 - 0.1529) = 0.8658 (87%), magenta as (1 - 0.3059 - 0.1529) / 0.8471 = 0.6389 (64%), and yellow as (1 - 0.8471 - 0.1529) / 0.8471 = 0%. Your final specification reads CMYK 87, 64, 0, 15 with total ink coverage of 166%, safe for both coated brochures and uncoated letterhead.
Put these specifications to work immediately: Convert your brand palette across all 5 formats.
Frequently asked questions
Why does my printed business card look darker than my monitor?
Monitors emit backlit light, while paper reflects room light. Uncoated paper absorbs ink further, making mid-tone CMYK colors appear 10% to 15% darker than sRGB previews.
Can I copy CMYK values directly into CSS?
No. Web browsers render sRGB and OKLCH color spaces. Use HEX, RGB, or OKLCH in CSS and keep CMYK strictly for print PDFs and packaging vendors.
What is the safest black ink formula for printed body copy?
Use pure K black (0, 0, 0, 100) for small body text so minor press registration shifts never create colored halos around thin letters.