Hue, saturation and lightness
In HSL, yellow and blue both have a lightness of 50%, yet yellow reflects almost 13 times as much light as blue by the WCAG luminance formula.
Drag to turn. Scroll or pinch to zoom.
Turning the cube into a cylinder
RGB numbers are easy for a screen and hard for a person. If you want "the same blue, a bit lighter", you have to change all three channels at once by different amounts. HSL rearranges the same sRGB colours so that the controls match how people talk about colour. CSS Color 4 describes it as a cylindrical model: a hue angle around the outside, a central axis for lightness from black to white, and a radius for saturation, which is how far a colour is from a neutral grey.
Picture the RGB cube standing on its black corner with white straight above. The grey axis is now vertical. Look down from above and the six vivid corners, red, yellow, green, cyan, blue and magenta, form a ring around the axis. HSL takes that ring, makes it round, and stretches the whole solid into a cylinder. The model above shows the result: a horizontal disk at the chosen lightness and an upright slice at the chosen hue and its opposite. Click anywhere on either surface to pick that colour.
Hue
Hue is an angle in degrees. CSS Color 4 fixes the starting point: 0deg is sRGB red, 120deg is green and 240deg is blue, and 360deg comes back to red. Halfway between the primaries are the secondaries: 60deg yellow, 180deg cyan and 300deg magenta. Because hue is an angle, it wraps around. A hue of 390deg is the same as 30deg, and adding 180deg to any hue lands on the colour directly across the circle.
Saturation and lightness
Saturation is a percentage. At 100% the colour sits on the outside of the cylinder and is as vivid as sRGB allows at that lightness. At 0% it sits on the central axis and is a grey; CSS Color 4 says the hue then has no effect at all, so hsl(0deg 0% 50%) and hsl(180deg 0% 50%) are the same grey. Lightness is also a percentage. 0% is black for every hue, 100% is white for every hue, and 50% gives the most vivid version of a hue. So hsl(0deg 100% 50%) is the same red as #ff0000, while hsl(120deg 100% 25%) is a dark green, rgb(0 128 0).
Where HSL misleads
HSL is convenient, and the CSS specification is frank about its limits. Its lightness is not the lightness your eye sees. Yellow, hsl(60deg 100% 50%), and blue, hsl(240deg 100% 50%), have the same L of 50%, but yellow looks far lighter. The WCAG luminance formula gives 0.9278 for that yellow and 0.0722 for that blue, a ratio of almost 13. The hue angle is not even either: the specification notes that a 30 degree step among blues looks small, while the same step between yellow and green looks large. Newer CSS spaces such as oklch() were designed to fix this. For checking whether text can be read, never trust HSL lightness. Use the contrast ratio, which you will compute in unit 6.
0deg red, 60deg yellow, 120deg green, 180deg cyan, 240deg blue, 300deg magenta.
- HSL is a cylinder: hue angle, saturation radius, lightness height.
- 0deg red, 120deg green, 240deg blue.
- At 0% saturation the hue has no effect; 0% lightness is black and 100% is white.
- HSL lightness does not match how bright a colour looks.
- What hue angle is pure sRGB green in HSL?
- What hue angle is magenta?
- What colour is hsl(0deg 100% 50%)?
- #ff0000
- #000000
- #ffffff
- #800000
- What colour is hsl(200deg 60% 100%)?
- White
- Light blue
- Black
- Grey
- hsl(0deg 0% 50%) and hsl(180deg 0% 50%) are...
- The same grey
- Red and cyan
- Black and white
- Different greys
- In the HSL cylinder, what does the distance from the central axis show?
- Saturation
- Hue
- Lightness
- Luminance
- A hue of 390deg is the same as what hue between 0 and 360?
- What is the WCAG relative luminance of pure yellow #ffff00? Give 4 decimal places.
- Yellow and blue both have HSL lightness 50%. Which looks lighter?
- Yellow
- Blue
- They look the same
- It depends on the hue angle only
- What colour is hsl(120deg 100% 25%)?
- rgb(0 128 0)
- rgb(0 255 0)
- rgb(128 255 128)
- rgb(64 64 64)
Sources for this course (14)
- W3C, Web Content Accessibility Guidelines (WCAG) 2.2, relative luminance (0.04045 threshold, note on the pre-May-2021 value 0.03928)
- contrast ratio (L1 + 0.05) / (L2 + 0.05)
- range 1:1 to 21:1, SC 1.4.1 Use of Color, 1.4.3 Contrast (Minimum) 4.5:1 and 3:1 for large-scale text (18 pt, or 14 pt bold)
- 1.4.6 Contrast (Enhanced) 7:1 and 4.5:1, 1.4.11 Non-text Contrast 3:1, WCAG 2.1 published June 2018 (w3.org/TR/WCAG22/)
- W3C, CSS Color Module Level 4, hex notation, hsl with 0deg red, 120deg green, 240deg blue, hsl(60deg 100% 50%) yellow vs hsl(240deg 100% 50%) blue at the same HSL lightness, hue spacing not perceptually uniform, HSL as a cylindrical model (w3.org/TR/css-color-4/)
- OpenStax College Physics 2e, 26.3 Color and Color Vision: about 6 million cones of three types, red + green gives yellow, no unique set of primaries (openstax.org/books/college-physics-2e/pages/26-3-color-and-color-vision)
- OpenStax Introduction to Behavioral Neuroscience, 6.2 The Retina: RGB pixels, CMY inks plus black, red-green colour blindness in about 8% of males (openstax.org/books/introduction-behavioral-neuroscience/pages/6-2-the-retina)
- Smithsonian Libraries, Color in a New Light, The Science of Color: Newton's prism experiments from the 1660s, Opticks 1704, Le Blon's Coloritto (London, about 1722) and the distinction between material colours and coloured light (library.si.edu/exhibition/color-in-a-new-light/science)
- The Newton Project (University of Oxford)
- Opticks 1704, Book I Part II Prop. VI: colour circle divided into seven parts in musical proportion, white at the centre (newtonproject.ox.ac.uk/view/texts/normalized/NATP00034)
- History of Information and Wikimedia Commons file record, Maxwell's 1861 Royal Institution demonstration, tartan ribbon photographed by Thomas Sutton through red, green and blue filters and projected together (historyofinformation.com/detail.php?id=3666)
- LibreTexts, Coalinga College Drawing Basics 8.4 Color Theory: complementary, analogous, split-complementary, triadic, tetradic (human.libretexts.org)
- RMIT Colour Theory, Interactive colour wheel and colour relationships (rmit.pressbooks.pub/colourtheory1)
- University of Delaware Library, Graphic Design guide, Color Schemes, 60/30/10 rule (guides.lib.udel.edu/design/color).
Checked: 2026-10-17