color

From Phosphor Dots to #FFFFFF: The Surprising History of HEX & RGB Colors

Six characters like #2563EB light up identically on a billion screens. Here's the strange, human story behind color codes — additive light, the mystery of 255, web-safe colors, and a purple with a hea

From Phosphor Dots to #FFFFFF: The Surprising History of HEX & RGB Colors
9min read
1.8Kwords
3views
3topics
🔢Try the toolHEX to RGB Converter

Somewhere right now, a designer in Tokyo and a developer in Toronto are both staring at the exact same shade of blue. Not a similar blue. The same one — pixel for pixel, photon for photon. They've never met, they're using different laptops, and yet a string as short as #2563EB guarantees their screens light up identically. That six-character code is one of the quiet miracles of the modern web, and almost nobody stops to think about how strange and clever it really is.

We type colour codes all day — into stylesheets, design tools, spreadsheets, game engines — and treat them like furniture. But every one of those little hex strings is a compressed history lesson in physics, mathematics, and a few very human decisions made decades ago. Let's pull one apart.

Your screen is mixing light, not paint

The first thing to unlearn is everything your primary-school art teacher told you. In a paint box, red and green make a muddy brown, and the more colours you add, the darker things get. That's subtractive colour: pigments work by absorbing wavelengths of light and reflecting what's left, so piling them on subtracts more and more until you approach black.

Screens do the opposite. A monitor starts from pure darkness and adds light. Look very closely at a switched-on display — a phone camera or a drop of water on the glass works as a magnifier — and you'll see that each pixel is actually three tiny lamps sitting side by side: one red, one green, one blue. They never physically blend. Your eye does the blending for you from a distance, fusing the three points into a single perceived colour. This is additive colour, and it flips the intuition completely: here, more light means brighter. Crank all three lamps to maximum and you get white. Switch them all off and you get black. Red plus green, which sounds like it should be sludge, gives you a cheerful yellow.

That trio — red, green, blue — is the entire vocabulary of your screen. Every photo, every video, every sunset on a wallpaper is just those three lamps at varying intensities, repeated across millions of pixels. RGB isn't a clever encoding someone invented for computers; it's a direct description of the hardware glowing in front of you.

The curious case of 255

So a colour is three numbers: how bright to make red, green, and blue. The obvious question is how bright? On a scale of what?

If humans had designed it purely for ourselves, we'd probably have picked nice round 0–100, like a percentage. Computers had other ideas. Each channel is stored in 8 bits — eight little on/off switches. Eight switches can be arranged in exactly 2⁸ = 256 distinct patterns, which gives a range of 0 to 255. That awkward-looking ceiling of 255 isn't arbitrary at all; it's simply the largest number eight bits can hold, written in binary as 11111111.

This is why a single channel never goes above 255, and why 255 keeps showing up everywhere in computing like a recurring character. An 8-bit chunk of data is called a byte, and a colour with three 8-bit channels is a tidy three bytes. Computers adore powers of two the way we adore tens, and colour quietly inherited that preference.

There's a small poetic side effect here. Pure red — red maxed out, green and blue dark — is rgb(255, 0, 0). The brightest, most saturated red your screen can physically produce is, in the machine's eyes, just a single byte turned all the way up and two bytes left alone.

Why count in sixteens?

Here's where the hash symbol earns its keep. We could happily write every colour as three decimal numbers, and indeed rgb(37, 99, 235) does exactly that. But back when memory was precious and colours were written by hand in markup, people wanted something more compact and more aligned with how the bytes actually sit in memory. Enter hexadecimal — counting in base 16 instead of base 10.

Hex uses the digits 0–9 and then borrows the letters A–F to represent the values 10 through 15. The magic is that a single byte (0–255) maps perfectly onto exactly two hex digits (00 to FF). No rounding, no leftovers — one byte, two characters, every time. That neat correspondence is the whole reason colour codes look the way they do.

A hex colour like #2563EB is simply three bytes wearing a disguise. Split it into pairs and you can read it like a sentence: 25 is the red channel, 63 is green, EB is blue. Convert each pair from base 16 back to ordinary base 10 and you land on rgb(37, 99, 235) — the same colour, just spoken in a different dialect. The # out front is borrowed from older notations meaning "a number follows," and it stuck.

There's even a shorthand for the tidy cases. When every channel happens to use a repeated digit, you can collapse #22BBEE down to #2BE; each digit is understood to be doubled. It's a small convenience, but it tells you something about the culture that built the web — economical, a little nerdy, always looking to save a few keystrokes.

Sixteen million colours (and the ones you'll never notice)

If each of the three channels has 256 possible values, the total number of colours you can express is 256 × 256 × 256. That works out to 16,777,216 — just shy of seventeen million. This is what marketing once proudly called "true colour" or "24-bit colour," and it became the standard precisely because it comfortably exceeds what the human eye can pick apart.

Or almost does. Our colour vision is wonderfully sensitive in some ranges and lazy in others. In smooth gradients — a clear sky fading from deep to pale blue — sharp-eyed people can sometimes spot faint "banding," the staircase edges where one of those 16 million steps jumps to the next. It's a reminder that 16.7 million, enormous as it sounds, is still a finite grid laid over the infinitely smooth reality of light. Professionals working in film and photography increasingly reach for 10-bit or higher colour to smooth those last visible seams.

The 216 colours that once ruled the web

Today we throw around all 16.7 million colours without a second thought, but it wasn't always so relaxed. In the mid-1990s, plenty of people browsed on monitors that could only display 256 colours at once. If a web page used a shade outside the system palette, the computer would "dither" it — faking the colour with a speckled checkerboard of the ones it did have, which looked rough.

The workaround was the legendary web-safe palette: a set of 216 colours chosen because they rendered identically across Windows and Mac without dithering. The number 216 wasn't random either — it's 6 × 6 × 6, a cube built from six evenly spaced values per channel. For years, conscientious designers restricted their entire palettes to this cube, and you can still spot its fingerprints in old hex codes full of 00, 33, 66, 99, CC, and FF. The constraint vanished as displays improved, but it's a charming fossil — a moment when the limits of hardware quietly shaped the look of an entire era of the internet.

Colours with names, and one with a story

Alongside the numbers, the web also speaks a vocabulary of named colours — words like tomato, gainsboro, papayawhip, and blanchedalmond that map to specific hex values. Most of these were inherited from the X Window System on Unix in the 1980s, assembled somewhat haphazardly by developers naming swatches after whatever was nearby. That's why the official list is such a delightful mess: there's dodgerblue (named after the baseball team's cap), several near-identical greys spelled both "grey" and "gray," and culinary oddities that sound like a brunch menu.

One named colour stands apart, and it's worth knowing. In 2014, the web developer and author Eric Meyer lost his six-year-old daughter, Rebecca, to cancer. She had recently decided her favourite colour was purple. Quietly, the people who steward the CSS specification added a new named colour to the language: rebeccapurple, set to the hex value #663399. It now ships in every modern browser. Every time that keyword renders somewhere in the world, it carries a small, deliberate act of kindness baked right into the standard. It's a rare thing — a technical specification with a heartbeat — and it's a good reminder that even the driest-looking parts of the web were written by people.

What HEX and RGB quietly get wrong

For all their elegance, these formats have a blind spot worth appreciating. The numbers describe how much light each lamp emits, not how bright the colour looks to you. Human perception is famously non-linear: the jump from rgb(0,0,0) to rgb(10,10,10) looks far more dramatic than the jump from rgb(200,200,200) to rgb(210,210,210), even though the raw difference is identical. Equal steps in the code are not equal steps to the eye.

This is exactly why other colour systems exist. HSL rearranges the same RGB information into hue, saturation, and lightness — friendlier for humans to reason about. More advanced models like LAB and the newer OKLCH try to space colours according to perceived difference, so that mathematically equal steps actually look equal. They're slowly making their way into CSS. None of this makes HEX and RGB obsolete; they remain the bedrock that every screen ultimately speaks. But it does explain why "just average the two hex codes" rarely produces the midpoint colour you imagined.

A tiny universal language

Strip away the layers and a colour code is a remarkable piece of design: three numbers, born from the physics of glowing phosphor and the mathematics of binary, compressed into six characters that mean precisely the same thing on every device ever built. It survived the jump from cathode-ray tubes to LCDs to OLEDs without changing a single rule. It works in a stylesheet, a paint program, a Python script, and a child's coding toy, all without translation.

So the next time a string like #2563EB slips by — in a brand guide, a bug report, a half-finished side project — it's worth a second of appreciation. It isn't just a colour. It's a sunset of red, green, and blue light, counted in sixteens, agreed upon by the whole world.

#color#design#web
Gaurav SinghWritten byGaurav SinghView profile →

More from the blog

Your BMI Was Invented by an Astronomer Who Never Meant It for Your Body

Body Mass Index runs modern medicine — but it began as a 19th-century population statistic by a Belgian stargazer, was renamed by a heart researcher in 1972, and reclassified millions overnight in 1998. Here's the strange, true story.

8 min read

Base64 Isn't Encryption: What It Actually Does (and Why the Web Needs It)

It looks scrambled, so people assume it's secret — but Base64 hides nothing. Here's what Base64 really is, how 3 bytes become 4 characters, why it's 33% bigger, and where it quietly runs the internet.

8 min read

Who Invented the Pomodoro Technique? The Tomato and the Science of Focus

The world's most famous focus method is named after a tomato-shaped kitchen timer. Here's the real story of the Pomodoro Technique — why 25 minutes, Parkinson's Law, the 23-minute cost of interruption

8 min read