{"course":{"slug":"design-foundations","title":"Design, before Any Software","url":"https://addaly.com/learn/design-foundations","level":"beginner","track":"create"},"lesson":{"slug":"why-hsl-lies-about-lightness","title":"The lightness slider is not lightness","url":"https://addaly.com/learn/design-foundations/why-hsl-lies-about-lightness","position":36,"of":74,"minutes":9,"answer":"HSL lightness is a position in the RGB cube rather than a measurement of brightness.","keyIdea":"HSL lightness is a position in the RGB cube rather than a measurement of brightness, so yellow and blue at the same L differ more than tenfold in luminance: build ramps in a perceptually uniform space such as OKLCH, or measure every swatch."},"body":{"format":"markdown","text":"## Two colours, same number, nothing alike\n\nTake `hsl(60, 100%, 50%)` and `hsl(240, 100%, 50%)`. Both claim 50% lightness. The first is a blazing yellow, the first thing you see on any page. The second is a deep blue you could set white text on.\n\nMeasure them properly and the gap is enormous. Relative luminance runs from 0 for black to 1 for white, and pure yellow comes out at about 0.93 while pure blue is about 0.07: more than a twelvefold difference between two colours the model says are equally light.\n\nThis is not a bug in HSL so much as a statement about what HSL was for. It is a convenient reparameterisation of RGB that makes colour pickers easy to build, and its L is a geometric position inside the RGB cube, not a measurement of how bright something looks.\n\n## Why blue is dark and yellow is bright\n\nThe eye is not equally sensitive to all wavelengths. Sensitivity peaks in the green region, around 555 nanometres in daylight vision, and falls away steeply towards both ends of the spectrum. That is why the luminance formula weights the channels so unevenly:\n\n```\nL = 0.2126·R + 0.7152·G + 0.0722·B\n```\n\nGreen contributes nearly three-quarters of perceived brightness and blue about seven per cent. Yellow, which is red plus green at full strength, inherits almost all of it. Blue has almost none to inherit.\n\nEverything downstream follows from this. It is why a yellow warning banner needs black text and a blue one needs white. It is why a naive greyscale conversion that averages the channels is wrong, as covered in the first block. And it is why a five-swatch palette that varies hue at constant HSL lightness collapses into an unusable mush of near-identical greys.\n\n## The model that does not lie: OKLCH\n\nA perceptually uniform colour space is one where equal numeric steps correspond to roughly equal perceived differences. OKLCH is the one now available directly in CSS, and it has three components:\n\n- **L**: perceptual lightness, 0 to 1. A colour at L 0.5 looks mid-grey whatever its hue.\n- **C**: chroma, how colourful. 0 is grey; the practical maximum varies by hue.\n- **H**: hue angle, 0 to 360.\n\n```css\n:root {\n  --brand-500: oklch(0.55 0.18 255);\n  --brand-300: oklch(0.75 0.12 255);\n  --brand-700: oklch(0.38 0.16 255);\n}\n```\n\nThis buys two things that are difficult otherwise.\n\n> Figure: Pure hues, all at HSL 50 per cent lightness. Bars (relative luminance, 0 is black and 1 is white): Yellow 0.93; Cyan 0.79; Green 0.72; Magenta 0.28; Red 0.21; Blue 0.07. Yellow carries more than twelve times the light of blue while the model reports both as equally light. That is why a yellow banner wants black text and a blue one white.\n\n**A ramp with even steps.** Move L by 0.08 each time and every step looks like the same size of change. In HSL the steps at the pale end are visually tiny and the steps at the dark end are enormous, which is why hand-built HSL ramps always need fiddling.\n\n**Categorical colours that match in lightness.** For a chart, you want six colours that differ in hue and are the same brightness, so no series looks more important than another. Hold L and C constant, vary H, and you have it. In HSL this is impossible without measuring every swatch.\n\nBrowser support for `oklch()` arrived across all the major engines in 2023, and Chrome, Firefox and Safari developer tools all show OKLCH values in their colour pickers now.\n\n## The limitation\n\nOKLCH can describe colours that a screen cannot show. Ask for `oklch(0.7 0.35 145)` and you are requesting a green more saturated than sRGB contains. The browser then maps it into gamut, and different browsers have historically clipped differently, which means the colour you get may not be the colour you specified, and it may not match between devices.\n\nPractical guardrails: keep chroma modest, around 0.1 to 0.2 for interface colours, which stays comfortably inside sRGB for most hues. Check anything vivid on a real screen. And if you need certainty, specify a fallback:\n\n```css\n.button { background: #2f6df6; background: oklch(0.55 0.18 255); }\n```\n\nThe second declaration wins where it is understood and is ignored where it is not.\n\n## What to take away\n\nIf you build palettes in HSL, and most tools still do, you are not obliged to abandon them. What you must do is stop trusting the L number and start measuring. Every browser's developer tools will give you a contrast ratio, which is a luminance measurement in disguise, and the greyscale check from the first block gives you the same information visually.\n\nThe rule that survives whichever model you use: **a palette is a set of lightness decisions with hues attached, not a set of hues with lightness attached.** Build the ramp first, in a space that measures lightness honestly, and choose the hue afterwards."},"check":{"question":"A designer builds a six-colour chart palette in HSL, holding lightness at 55% and varying hue evenly around the wheel. In greyscale the yellow series nearly disappears and the blue one looks almost black. Why?","options":[{"text":"Six hues is too many for one chart, and any categorical palette beyond four will contain pairs that converge in greyscale.","correct":false,"tempting":"Raises a real limit on distinguishable categories, which does not explain why two specific series sit at opposite extremes of lightness."},{"text":"The saturation was left at 100%, and fully saturated colours always diverge in luminance regardless of the lightness setting.","correct":false,"tempting":"Correctly notes that high chroma widens the spread while implying that reducing saturation alone would equalise luminance across hues."},{"text":"HSL lightness is a geometric position in the RGB cube, so equal L values produce wildly different luminance across hues.","correct":true},{"text":"Greyscale conversion applies a gamma curve that HSL does not account for, so the ranking of the swatches changes when the colour is removed.","correct":false,"tempting":"Blames the conversion step for a difference that is already present in the colours themselves before any conversion."}]},"prev":{"slug":"contrast-beats-palette","title":"A palette will not save an unreadable page","url":"https://addaly.com/learn/design-foundations/contrast-beats-palette"},"next":{"slug":"the-contrast-ratio-formula","title":"What a contrast checker is actually computing","url":"https://addaly.com/learn/design-foundations/the-contrast-ratio-formula"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'The lightness slider is not lightness', in Design, before Any Software. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/design-foundations/why-hsl-lies-about-lightness (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"The lightness slider is not lightness","courseTitle":"Design, before Any Software","module":{"index":4,"slug":"colour-measured","title":"Colour, measured"},"answer":null,"keyIdea":"HSL lightness is a position in the RGB cube rather than a measurement of brightness, so yellow and blue at the same L differ more than tenfold in luminance: build ramps in a perceptually uniform space such as OKLCH, or measure every swatch.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"caption":"Yellow carries more than twelve times the light of blue while the model reports both as equally light. That is why a yellow banner wants black text and a blue one white.","series":[{"highlight":true,"label":"Yellow","value":0.93},{"label":"Cyan","value":0.79},{"label":"Green","value":0.72},{"label":"Magenta","value":0.28},{"label":"Red","value":0.21},{"highlight":true,"label":"Blue","value":0.07}],"title":"Pure hues, all at HSL 50 per cent lightness","type":"bars","unit":"relative luminance, 0 is black and 1 is white"},"alt":"Figure: Pure hues, all at HSL 50 per cent lightness. Bars (relative luminance, 0 is black and 1 is white): Yellow 0.93; Cyan 0.79; Green 0.72; Magenta 0.28; Red 0.21; Blue 0.07. Yellow carries more than twelve times the light of blue while the model reports both as equally light. That is why a yellow banner wants black text and a blue one white."}},"blocks":[{"t":"h2","id":"two-colours-same-number-nothing-alike","runs":[{"text":"Two colours, same number, nothing alike"}]},{"t":"p","runs":[{"text":"Take "},{"text":"hsl(60, 100%, 50%)","code":true},{"text":" and "},{"text":"hsl(240, 100%, 50%)","code":true},{"text":". Both claim 50% lightness. The first is a blazing yellow, the first thing you see on any page. The second is a deep blue you could set white text on."}]},{"t":"p","runs":[{"text":"Measure them properly and the gap is enormous. Relative luminance runs from 0 for black to 1 for white, and pure yellow comes out at about 0.93 while pure blue is about 0.07: more than a twelvefold difference between two colours the model says are equally light."}]},{"t":"p","runs":[{"text":"This is not a bug in HSL so much as a statement about what HSL was for. It is a convenient reparameterisation of RGB that makes colour pickers easy to build, and its L is a geometric position inside the RGB cube, not a measurement of how bright something looks."}]},{"t":"h2","id":"why-blue-is-dark-and-yellow-is-bright","runs":[{"text":"Why blue is dark and yellow is bright"}]},{"t":"p","runs":[{"text":"The eye is not equally sensitive to all wavelengths. Sensitivity peaks in the green region, around 555 nanometres in daylight vision, and falls away steeply towards both ends of the spectrum. That is why the luminance formula weights the channels so unevenly:"}]},{"t":"code","lang":"","label":"Text","text":"L = 0.2126·R + 0.7152·G + 0.0722·B"},{"t":"p","runs":[{"text":"Green contributes nearly three-quarters of perceived brightness and blue about seven per cent. Yellow, which is red plus green at full strength, inherits almost all of it. Blue has almost none to inherit."}]},{"t":"p","runs":[{"text":"Everything downstream follows from this. It is why a yellow warning banner needs black text and a blue one needs white. It is why a naive greyscale conversion that averages the channels is wrong, as covered in the first block. And it is why a five-swatch palette that varies hue at constant HSL lightness collapses into an unusable mush of near-identical greys."}]},{"t":"h2","id":"the-model-that-does-not-lie-oklch","runs":[{"text":"The model that does not lie: OKLCH"}]},{"t":"p","runs":[{"text":"A perceptually uniform colour space is one where equal numeric steps correspond to roughly equal perceived differences. OKLCH is the one now available directly in CSS, and it has three components:"}]},{"t":"ul","items":[[{"text":"L","b":true},{"text":": perceptual lightness, 0 to 1. A colour at L 0.5 looks mid-grey whatever its hue."}],[{"text":"C","b":true},{"text":": chroma, how colourful. 0 is grey; the practical maximum varies by hue."}],[{"text":"H","b":true},{"text":": hue angle, 0 to 360."}]]},{"t":"code","lang":"css","label":"CSS","text":":root {\n  --brand-500: oklch(0.55 0.18 255);\n  --brand-300: oklch(0.75 0.12 255);\n  --brand-700: oklch(0.38 0.16 255);\n}"},{"t":"p","runs":[{"text":"This buys two things that are difficult otherwise."}]},{"t":"p","runs":[{"text":"A ramp with even steps.","b":true},{"text":" Move L by 0.08 each time and every step looks like the same size of change. In HSL the steps at the pale end are visually tiny and the steps at the dark end are enormous, which is why hand-built HSL ramps always need fiddling."}]},{"t":"p","runs":[{"text":"Categorical colours that match in lightness.","b":true},{"text":" For a chart, you want six colours that differ in hue and are the same brightness, so no series looks more important than another. Hold L and C constant, vary H, and you have it. In HSL this is impossible without measuring every swatch."}]},{"t":"p","runs":[{"text":"Browser support for "},{"text":"oklch()","code":true},{"text":" arrived across all the major engines in 2023, and Chrome, Firefox and Safari developer tools all show OKLCH values in their colour pickers now."}]},{"t":"h2","id":"the-limitation","runs":[{"text":"The limitation"}],"role":"limit"},{"t":"p","runs":[{"text":"OKLCH can describe colours that a screen cannot show. Ask for "},{"text":"oklch(0.7 0.35 145)","code":true},{"text":" and you are requesting a green more saturated than sRGB contains. The browser then maps it into gamut, and different browsers have historically clipped differently, which means the colour you get may not be the colour you specified, and it may not match between devices."}]},{"t":"p","runs":[{"text":"Practical guardrails: keep chroma modest, around 0.1 to 0.2 for interface colours, which stays comfortably inside sRGB for most hues. Check anything vivid on a real screen. And if you need certainty, specify a fallback:"}]},{"t":"code","lang":"css","label":"CSS","text":".button { background: #2f6df6; background: oklch(0.55 0.18 255); }"},{"t":"p","runs":[{"text":"The second declaration wins where it is understood and is ignored where it is not."}]},{"t":"h2","id":"what-to-take-away","runs":[{"text":"What to take away"}]},{"t":"p","runs":[{"text":"If you build palettes in HSL, and most tools still do, you are not obliged to abandon them. What you must do is stop trusting the L number and start measuring. Every browser’s developer tools will give you a contrast ratio, which is a luminance measurement in disguise, and the greyscale check from the first block gives you the same information visually."}]},{"t":"p","runs":[{"text":"The rule that survives whichever model you use: "},{"text":"a palette is a set of lightness decisions with hues attached, not a set of hues with lightness attached.","b":true},{"text":" Build the ramp first, in a space that measures lightness honestly, and choose the hue afterwards."}]}],"check":{"question":[{"text":"A designer builds a six-colour chart palette in HSL, holding lightness at 55% and varying hue evenly around the wheel. In greyscale the yellow series nearly disappears and the blue one looks almost black. Why?"}],"options":[{"text":[{"text":"Six hues is too many for one chart, and any categorical palette beyond four will contain pairs that converge in greyscale."}],"correct":false,"tempting":[{"text":"Raises a real limit on distinguishable categories, which does not explain why two specific series sit at opposite extremes of lightness."}]},{"text":[{"text":"The saturation was left at 100%, and fully saturated colours always diverge in luminance regardless of the lightness setting."}],"correct":false,"tempting":[{"text":"Correctly notes that high chroma widens the spread while implying that reducing saturation alone would equalise luminance across hues."}]},{"text":[{"text":"HSL lightness is a geometric position in the RGB cube, so equal L values produce wildly different luminance across hues."}],"correct":true,"tempting":null},{"text":[{"text":"Greyscale conversion applies a gamma curve that HSL does not account for, so the ranking of the swatches changes when the colour is removed."}],"correct":false,"tempting":[{"text":"Blames the conversion step for a difference that is already present in the colours themselves before any conversion."}]}],"order":[0,2,1,3],"why":null},"prev":{"slug":"contrast-beats-palette","title":"A palette will not save an unreadable page","minutes":10},"next":{"slug":"the-contrast-ratio-formula","title":"What a contrast checker is actually computing","minutes":9}}}