Light and the eye
Visible light is the thin slice of electromagnetic radiation between roughly 380 and 750 nanometres. A light source has a spectrum — power at every wavelength — and a surface has a reflectance curve. What reaches your eye is their product.
The retina samples that light with three kinds of cone cell: L, M and S, peaking around 560, 530 and 420 nm. Everything you will ever see as colour is compressed into those three responses — which is why three numbers are enough to describe a colour, and why three primaries are enough to fake one.
Trichromacy and metamerism
Thomas Young proposed three kinds of receptor in his 1802 Bakerian Lecture; Hermann von Helmholtz developed the idea in 1850, and in 1857 James Clerk Maxwell gave the Young–Helmholtz theory a mathematical footing. The consequence is metamerism: two physically different spectra that produce the same three cone responses look identical. Your monitor depends on it — its red, green and blue sub-pixels produce a spectrum nothing like a lemon, yet the cones cannot tell.
Metamerism is also why two fabrics can match in the shop and clash in daylight: change the illuminant and the products with each reflectance curve diverge.
CIE 1931 and XYZ
In 1931 the Commission Internationale de l'Éclairage standardised the results of Wright's and Guild's matching experiments as three colour-matching functions x̄(λ), ȳ(λ), z̄(λ). Integrating a spectrum against them gives the tristimulus values X, Y, Z. They were chosen so that all values are positive and Y equals photometric luminance.
Divide out the brightness and you get chromaticity: x = X / (X+Y+Z), y = Y / (X+Y+Z). Plot every pure wavelength and you trace the famous horseshoe — explore it on the Chromaticity page. Any colour made by mixing two lights lies on the straight line between them, which is why each RGB display covers a triangle.
Try it: Chromaticity → · Converter →
RGB, primaries and gamma
An RGB space is fully defined by three things: the chromaticities of its primaries, a white point, and a transfer function. sRGB (HP & Microsoft, 1996) uses the Rec. 709 primaries, the D65 white point, and a curve of roughly gamma 2.2.
Arithmetic on light — blending, blurring, resizing — must happen on linear values. Averaging encoded values is why naive gradients and downscaled images often look too dark.
Try it: Gamma Explorer →
HSL, HSV and why they lie
HSV and HSL (both 1978) re-arrange the RGB cube into cylinders so people can think in hue, saturation and lightness. They are geometric conveniences, not models of perception. Both swatches below are hsl(… 100% 50%) — identical “lightness”:
Their CIELAB lightness differs by more than 60 points. Use a perceptual space whenever lightness matters — accessible palettes, data visualisation, gradients.
Try it: Color Picker → · 3D Color Spaces →
CIELAB: measuring what we see
In 1942 David MacAdam showed that the colours people cannot tell apart form ellipses on the xy diagram, and that their size and orientation vary widely from one colour to another. Equal distances in xy are not equal differences to the eye. CIELAB (1976) warps XYZ to fix this: a cube-root compression mimics the eye's response, and three opponent axes mirror how the visual system encodes colour.
Opponent channels echo Ewald Hering's opponent-colour theory (1892): nobody reports a reddish green or a yellowish blue, because red–green and blue–yellow behave as two ends of the same signal. Slice CIELAB on the Lab Matrix page or orbit it in 3D.
Try it: Lab Matrix → · Converter →
ΔE: how different is different?
The colour difference ΔE*76 is simply the straight-line distance in CIELAB. Every ΔE formula is designed so that 1.0 stands for roughly one just-noticeable difference, although for ΔE*76 the JND was later put at about 2.3. CIELAB is not perfectly uniform, especially in the blues, so the formula was revised: ΔE*94 weights chroma and hue, and CIEDE2000 (published 2001) adds a rotation term for the blue region, a lightness weighting and a chroma correction for near-neutrals.
A common industry rule of thumb — not a standard — reads ΔE00 below 1 as imperceptible, 1–2 as visible on close inspection and above 10 as clearly different colours. Try it on Contrast & ΔE.
Try it: Contrast & ΔE →
OKLab and the modern web
In December 2020 Björn Ottosson published OKLab: a simple space — one matrix, a cube root, another matrix — designed to fix CIELAB's unexpected hue and lightness shifts in the blues. Desaturate a vivid blue in CIELAB LCh and it drifts toward purple (see below); OKLCH holds the hue. oklab() and oklch() are part of CSS Color 4, which also gamut-maps in OKLCh and makes OKLab the default interpolation space for colours written in modern syntax (legacy hex and rgb() colours still blend in sRGB for compatibility). See the difference on the Gradients page.
Try it: Gradients → · Lab Matrix →
Color harmony: a short history
Classical harmonies — complementary, analogous, triadic, split-complementary, tetradic — are geometric rules on a wheel. They are useful starting points rather than laws: colour-theory reviews note that such formulae have limited practical application. Which wheel you use also changes the result: RYB puts violet opposite yellow, RGB puts blue there. Try both on the Harmony wheel.
Try it: Harmony Wheel → · Palettes →
Simultaneous contrast
Chevreul noticed that a colour shifts away from its surroundings. The two small squares below are exactly the same grey:
This is why a colour picked in isolation never looks the same in a layout — and why legibility metrics like WCAG and APCA compare a pair of colours, not one.
Text contrast: WCAG 2 and APCA
Whether text is readable depends mostly on the lightness difference between the text and its background — hue barely matters. The web's accessibility rules turn that into a number.
WCAG 2 (W3C, 2008; current version 2.2) uses a contrast ratio: (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colour. It runs from 1:1 (no contrast) to 21:1 (black on white). Level AA asks for at least 4.5:1 for body text and 3:1 for large text (about 24 px, or 19 px bold) and for icons and other graphics; level AAA asks for 7:1 and 4.5:1. WCAG 2 is the standard that accessibility laws refer to.
The ratio is simple, but it does not match vision well in two places: it overrates contrast among dark colours, and it gives the same score whichever colour is the text. APCA (Accessible Perceptual Contrast Algorithm, Andrew Somers, developed as a candidate for the still-draft WCAG 3) models perceived lightness contrast instead. It reports a lightness contrast Lc from 0 to about 106 for dark text on a light background, and down to about −108 for light text on dark. Its targets depend on font size and weight: roughly Lc 75 for body text (90 preferred), 60 for other reading text, 45 for large headings, and 30 for icons and non-essential text.
The same grey, #777777, passes WCAG on black but fails it on white — while APCA says the opposite, and your eyes usually agree with APCA. On orange, WCAG strongly prefers black text, while APCA rates black and white about equally. In practice: meet WCAG 2 where it is required, and use APCA as the better guide to what actually reads well.
Try it: Contrast & ΔE →
Color vision deficiency
About 8% of men and 0.5% of women of Northern European ancestry have a red–green deficiency: a missing or shifted L cone (protan) or M cone (deutan). Deuteranomaly alone affects about 5% of men. Blue–yellow (tritan) defects affect fewer than 0.01% of people, and complete achromatopsia is rarer still. Simulations such as Machado, Oliveira & Fernandes (2009) project colours into the reduced space a dichromat can see — run any image through them on the Image Lab.
Practical rule: never let hue be the only difference. Pair colour with lightness contrast, shape, labels or texture.
Try it: Image Lab → · Palettes →
What do we call it? Naming colours
People with normal colour vision see colours in much the same way, yet we disagree surprisingly often about what to call them. Where does green end and blue begin? Is that teal, turquoise or aqua? Languages don't even agree on how many basic colour words there are: Russian has two everyday words for blue, goluboy for light blue and siniy for dark blue, while some languages use one word for both green and blue.
In 2010 Randall Munroe of xkcd ran an online colour-naming survey: people were shown random colours and typed whatever name came to mind. Over five million colours were named in about 222,500 sessions. Among the findings: nobody can spell "fuchsia", and "puke" really is a colour.

Munroe checked the joke against the real data: men and women mostly used the same names, and women were just a little more generous with words like "dusty" and "pale".
The survey's most common answers became a list of almost 950 named colours, released into the public domain. huebic uses it: names like "sunflower" and "dusty rose" in the colour search and on the colour pages come from that list.
huebic also knows three more systematic lists. RAL Classic is the paint standard used in building and industry ("RAL 3020 Traffic red"). ISCC-NBS, from the US National Bureau of Standards, describes any colour in plain words, such as "moderate purplish pink". And Sanzo Wada's Dictionary of Colour Combinations (1933–34) gave 159 colours poetic names like "Hermosa Pink" and paired them into 348 combinations, still loved by designers.
Try it: Color names → · press / to search by name
Why is the sky blue, and sunsets red?
Sunlight contains every visible wavelength. On its way through the atmosphere it meets air molecules far smaller than a wavelength of light, and they scatter it in all directions — Rayleigh scattering. The effect is much stronger for short wavelengths: it scales with 1/λ⁴, so blue light at 450 nm is scattered almost six times more than red light at 700 nm. Look at any part of the sky away from the sun and you see sunlight that the air has redirected towards you — and that light is mostly blue. The sky does not look violet, even though violet is scattered even more, because sunlight contains less violet and our eyes are much less sensitive to it.
Larger particles — haze, dust, water droplets — scatter all wavelengths about equally and mostly forward. This Mie scattering is the white glow around the sun and the paler, milkier sky near the horizon on a hazy day.
When the sun is low, its light crosses far more air: about 38 times as much at the horizon as overhead. Along that path most of the blue is scattered away before it reaches you, so the sun turns yellow, then orange and red, and lights the clouds and the sky around it with what is left. The ozone layer adds a subtler touch: it absorbs a band of orange-yellow light (the Chappuis band), which is why the zenith stays deep blue through twilight instead of turning grey — something Edward Hulburt showed in the early 1950s.
After sunset, look the other way. Just above the eastern horizon a dark blue-grey band rises — the shadow of the Earth itself, cast on the atmosphere — and above it glows a pink arch, the Belt of Venus, where the reddened light of the set sun is scattered back towards you. Photographers call the warm, low-sun period the golden hour (roughly while the sun is less than 6° high) and the deep-blue twilight after it the blue hour (the sun about 4–8° below the horizon); neither has an official definition.
The huebic Sky Lab computes all of this per wavelength. It was inspired by Maxime Heckel's “On Rendering the Sky, Sunsets, and Planets” (2026), a beautifully interactive walk through Rayleigh and Mie scattering, ozone and light-marching, written for real-time shaders. Heckel works in three color channels, as games do; the huebic Sky Lab follows the same physics across the spectrum and turns the result into color with the CIE observer, so its gradients and palettes come straight out of the same color science as the rest of huebic. It then shows the sky as a person standing there would see it: eyes adapted to daylight, adjusting only partly as dusk falls, and losing color in deep twilight as the eye's rods take over from its cones.
Try it: Sky Lab → · Gradients →
Light and health
Light does more than let us see. Particular wavelengths drive the body clock, make vitamin D, break down bilirubin and power several medical treatments — and the same light at the wrong dose burns skin or damages the retina. The effect depends on wavelength, intensity, duration and timing, not on the colour you perceive, so a “blue” screen and a 450 nm therapy lamp are very different doses.
Below are ten wavelengths often quoted in light therapy, with what the evidence actually supports. The ratings are ours: Established means standard medical practice or settled physiology; Emerging means proven for some uses and still being researched for others; Promising means encouraging early studies. This is background reading, not medical advice.
Ultraviolet B Established
Invisible. UVB at 290–300 nm lets the skin turn 7-dehydrocholesterol into vitamin D₃ — for most people the main source of the vitamin. Narrowband UVB lamps (311–313 nm) are the most common light treatment for psoriasis, vitiligo and eczema. Dose matters: too much UVB causes sunburn and DNA damage, and is linked to skin cancer and cataracts.
Violet / indigo Emerging
Absorbed by porphyrins inside bacteria, which then produce reactive oxygen and die — the likely reason Niels Finsen’s Nobel-winning lamp (around 400 nm, not UV as he thought) worked against a skin infection. 405 nm light kills many pathogens in lab studies and has been trialled for disinfecting rooms. Blue and blue–violet light is also used for mild acne, with moderate benefit in studies so far.
Blue Established
The wavelength of the blue LED inside almost every white LED. Melanopsin, the pigment in the retina’s light-sensitive ganglion cells that sets the body clock, peaks at about 480 nm and is roughly half as sensitive at 445 nm — still enough that blue-rich light suppresses melatonin and shifts circadian timing: helpful by day, disruptive at night. Blue light at 460–490 nm is the standard treatment for newborn jaundice, turning bilirubin into compounds the baby can excrete. Lamp safety standards limit very intense sources (the “blue-light hazard”); everyday screens have not been shown to harm eyes. Blue-blocking glasses worn before bed may help some people with insomnia or delayed sleep phase.
Cyan Established
Sits between melanopsin’s peak (about 480 nm) and the rods’ peak (about 498 nm), so it strongly drives both the clock-setting response and night vision. Melanopic lux — the lighting metric for circadian effect — weights this region most. Light boxes for seasonal depression use either 10,000 lux of white light or lower doses of blue-to-green light (460–525 nm).
Green Promising
Near the eye’s peak sensitivity (555 nm), so it looks brightest per watt. A 1995 study found 350 lux of green light shifted the body clock as much as 10,000 lux of white. Studies of migraine found narrow-band green light worsened light sensitivity less than other colours, and a small trial reported fewer headache days after daily green-light exposure. An encouraging area of research.
Yellow Established
Strongly absorbed by haemoglobin. Pulsed dye lasers in the yellow–orange (around 585 nm) are tuned to it to treat port-wine stains, scars and other blood-vessel disorders while sparing the surrounding skin. Low-power yellow LEDs are also used in skin care, an area still being researched.
Amber Established
Barely stimulates melanopsin, so amber light is the choice for evening and night lighting and for “night mode” screens. By day the body still needs bright, blue-rich light, so amber works best as an evening light. Amber LEDs are also being explored for skin treatment.
Red Emerging
The main band of photobiomodulation (“red light therapy”), thought to act on cytochrome c oxidase in mitochondria. It works close to the surface: about 1% of 650 nm light reaches 1.6 mm into skin. It appears effective for preventing mouth sores (oral mucositis) during cancer treatment, and daily low-level red light slowed myopia in children in randomised trials. Photodynamic therapy, often with red light, treats some superficial skin cancers. Hair regrowth shows encouraging early results, and research into skin ageing and general wellbeing continues.
Deep red Established
Tissue becomes much more transparent from here into the near-infrared. Light at about 690 nm activates verteporfin, a photodynamic drug approved since 1999 for wet age-related macular degeneration. Deep-red photobiomodulation is being studied alongside red light for the same uses.
Near-infrared Emerging
Invisible. Tissue is most transparent at roughly 700–850 nm, so near-infrared goes deepest. Near-infrared diode lasers are an established tool for hair removal, heating the melanin in the follicle. Near-infrared photobiomodulation for pain, wound healing and the brain is an active research field, with results that depend on dose and condition.
Two practical takeaways hold up well: get bright light during the day and keep evening light dim and warm; and treat any claim about a specific colour as a claim about a specific dose.
Glossary
- Hue
- The attribute by which a colour is called red, yellow, green, blue…
- Chroma
- Colourfulness relative to a white of the same brightness. Saturation is colourfulness relative to the colour's own brightness.
- Lightness
- Brightness relative to a white. L* and OKLab L model it.
- Luminance
- Photometric light weighted by the eye's sensitivity (CIE Y). Physical, linear.
- White point
- The chromaticity treated as neutral — D65 (daylight, 6504 K) for screens, D50 for print.
- Gamut
- The set of colours a device or space can produce.
- Chromatic adaptation
- The eye's white balance; modelled by transforms such as Bradford when converting between white points.
- Metamers
- Different spectra that look identical to a given observer under a given light.
- CCT
- Correlated colour temperature: the black-body temperature whose colour is closest to a light source.
Sources
The text on this page is original writing, fact-checked against the references below. Numbers in the figures are computed live from the same formulas the tools use.
- Wikipedia: Visible spectrum, Cone cell, Young–Helmholtz theory, Metamerism, CIE 1931 color space, Luminous efficiency function, sRGB, HSL and HSV, MacAdam ellipse, CIELAB color space, Opponent process, Color difference, Oklab color space, Color wheel, Color theory, Michel Eugène Chevreul, Munsell color system, Johannes Itten, Josef Albers, Color blindness.
- CIE 1931 2° standard observer, 1 nm table (CIE 018:2019), via the colour-science library.
- W3C CSS Color Module Level 4 — conversion matrices, D50 Lab with Bradford adaptation, gamut mapping, interpolation.
- IEC 61966-2-1:1999 (sRGB) · ITU-R BT.709 and BT.2020.
- B. Ottosson, “A perceptual color space for image processing” (2020).
- G. Sharma, W. Wu, E. Dalal, “The CIEDE2000 color-difference formula: implementation notes”, Color Research & Application 30 (2005).
- G. Machado, M. Oliveira, L. Fernandes, “A physiologically-based model for simulation of color vision deficiency”, IEEE TVCG 15 (2009).
- R. Munroe, “Color Survey Results”, xkcd blog (2010), with the comic by Doghouse Diaries shown there · the xkcd colour list (CC0).
- Color name lists: RAL Classic via ral_colors_list (MIT; RAL is a trademark of RAL gGmbH, screen values are approximations) · ISCC-NBS names (Kelly & Judd, NBS Circular 553) with sRGB centroids from P. Centore, “sRGB Centroids for the ISCC-NBS Colour System” (2016) · Sanzo Wada, A Dictionary of Colour Combinations (1933–34), data by Matt DesLauriers after Dain M. Blodorn Kim (MIT).
- J. Winawer et al., “Russian blues reveal effects of language on color discrimination”, PNAS 104 (2007) · B. Berlin, P. Kay, Basic Color Terms (1969).
- C. S. McCamy, “Correlated color temperature as an explicit function of chromaticity coordinates”, Color Research & Application 17 (1992).
- Light and health — Wikipedia: Light therapy, Melanopsin, Intrinsically photosensitive retinal ganglion cell, Neonatal jaundice, Vitamin D, Ultraviolet light therapy, Photodynamic therapy, Low-level laser therapy, Dye laser, Laser hair removal, Biological effects of high-energy visible light.
- T. M. Brown et al., “Recommendations for daytime, evening, and nighttime indoor light exposure to best support physiology, sleep, and wakefulness in healthy adults”, PLOS Biology 20 (2022) · CIE S 026/E:2018, metrology for ipRGC-influenced responses to light.
- A. R. Kemper et al., AAP clinical practice guideline on hyperbilirubinemia in the newborn, Pediatrics 150 (2022) · IARC Monographs 100D (UV radiation) · IEC 62471, photobiological safety of lamps.
- S. Singh, L. E. Downie, A. J. Anderson, “Blue-light filtering spectacle lenses for visual performance, sleep, and macular health in adults”, Cochrane Database of Systematic Reviews (2023).
- M. Maclean et al., “Inactivation of bacterial pathogens following exposure to light from a 405-nanometer light-emitting diode array”, Applied and Environmental Microbiology 75 (2009).
- R. Noseda et al., “Migraine photophobia originating in cone-driven retinal pathways”, Brain 139 (2016) · L. F. Martin et al., green light exposure and headache frequency in migraine, Cephalalgia 41 (2021).
- Y. Zadik et al., MASCC/ISOO review and guidelines on photobiomodulation for oral mucositis, Supportive Care in Cancer 27 (2019) · Y. Jiang et al., repeated low-level red-light therapy for myopia control in children, Ophthalmology 129 (2022).
- Sky and sunsets — M. Heckel, “On Rendering the Sky, Sunsets, and Planets” (2026) · S. Hillaire, “A Scalable and Production Ready Sky and Atmosphere Rendering Technique”, Computer Graphics Forum 39 (2020) · E. Bruneton, F. Neyret, “Precomputed Atmospheric Scattering”, Computer Graphics Forum 27 (2008) · E. O. Hulburt, “Explanation of the brightness and color of the sky, particularly the twilight sky”, JOSA 43 (1953) · NOAA solar position equations · Wikipedia: Rayleigh scattering, Mie scattering, Diffuse sky radiation, Air mass, Chappuis absorption, Earth's shadow, Belt of Venus, Golden hour, Blue hour.
- WCAG 2.2 contrast criteria (W3C) · APCA 0.0.98G-4g (Myndex).