Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

Your screen can show colours brighter than #fff. CSS just can't ask for them

#fff feels like the brightest colour a web page can show. On most laptops and phones made in the last few years, it isn't. HDR screens can go several times brighter than the white of this page. Apple Photos uses that ex

#fff feels like the brightest colour a web page can show.

On most laptops and phones made in the last few years, it isn't. HDR screens can go several times brighter than the white of this page. Apple Photos uses that extra brightness. So do YouTube HDR videos and the LinkedIn app.

CSS doesn't let you use it. There's no color: #fff × 3.

So I built Brighter Than White, a small tool that runs entirely in the browser. You upload a logo, pick the colours that should glow, and download an HDR image. It also has a CSS trick that makes text glow.

⚠️ You need an HDR screen to see the effect. On a normal screen everything below looks like plain white. That's expected, and it's also the whole point.

Why CSS can't do it

CSS colours are written for SDR, the normal brightness range. #fff means "as bright as normal white", and nothing goes higher.

Images are different. Modern JPEGs can carry a gain map: a small extra grayscale layer that tells HDR screens how much brighter to make each pixel. Screens that understand it show the boosted version. Every other screen ignores it and shows the normal image.

So the trick is to let an image do what CSS can't.

Part 1: Making an image glow

Here's what the tool does when you upload a logo:

  1. Mask. Each pixel gets a score from 0 to 255 based on how close it is to the colours you picked. Pixels in your brand colour score high. Everything else scores zero.
  2. Gain map. That score is saved as the grayscale gain-map layer inside the JPEG. On an HDR screen, the picked colours get boosted up to 7.5×. The rest of the logo stays exactly as you drew it.
  3. LinkedIn version. A second export bakes the boost straight into the pixels using Rec.2100 PQ (with SDR white at 203 nits) and adds the matching colour profile. That's the file that glows in the LinkedIn app.
  4. Privacy. The encoder is written in TypeScript and runs in a Web Worker. Your image never leaves your device. There's no server, no upload, no account.

The result: your logo looks normal everywhere, and on an HDR phone the accent colour glows like a light source.

Part 2: Making text glow with CSS

You can't make a CSS colour brighter than white. But you can cut letters out of an image:

.btw-glow-text {
  color: #fff; /* SDR fallback */
}

@media (dynamic-range: high) {
  @supports (background-clip: text) or (-webkit-background-clip: text) {
    .btw-glow-text {
      background: url("brighter-than-white-swatch-7.5x.jpg") center / cover;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
  }
}
<p class="btw-glow-text">Glow on HDR screens</p>

How it works:

  • The background is a tiny gain-map JPEG (about 3 KB) that's just one flat, boosted white.
  • background-clip: text shows that image only inside the letters.
  • color: transparent hides the normal text colour so the image shows through.
  • @media (dynamic-range: high) means SDR screens never load any of this and just get #fff.

Use it for headlines and accents. A whole paragraph glowing at 7.5× brightness is hard on the eyes.

Detecting HDR

The same check works in CSS and JavaScript.

CSS:

.headline {
  color: #fff; /* every screen */
}

@media (dynamic-range: high) {
  .headline {
    /* HDR screens only */
  }
}

JavaScript:

const query = window.matchMedia("(dynamic-range: high)");

function update() {
  document.documentElement.classList.toggle("hdr", query.matches);
}

update();
query.addEventListener("change", update); // fires when the window moves to another display

Listen for change. If someone drags the window from an HDR laptop screen to a normal monitor, the answer changes.

One catch: this query tells you about the screen, not the browser. A browser that can't draw HDR images can still report true on an HDR screen. The tool also checks the browser version (Chrome 137+, Safari 26) before saying the glow is real.

Known limits (honest list)

  • You need three things at once: an HDR screen, HDR turned on, and an app that reads gain maps or PQ. I've tested it in Chrome 137+, Safari 26 / iOS 26, Apple Photos and the LinkedIn app. On Android it glows on a Samsung Galaxy S23; an older Xiaomi phone showed nothing.
  • Black stays black. Deep colours get brighter but look like dim neon. Pale colours on dark backgrounds work best.
  • The peak is 7.5× (about 1,500 nits). Screens scale it down to what they can show.
  • Images bigger than 2048 px are scaled down, transparent areas never glow, and the output is always a JPEG.
  • If a site strips the colour profile, the PQ file can look dark and flat. Use the HDR JPEG there instead.

Try it

👉 brighter-than-white.vercel.app

Open it on an HDR phone or a recent MacBook. On a MacBook, check System Settings → Displays → High Dynamic Range first.

If it glows (or doesn't) on your device, let me know in the comments with your phone or browser. I'm building a list of what works where.

☕ If This Helped You

I publish free tutorials and write-ups like this regularly.

If this article saved you time:

👉 Buy me a coffee:

https://buymeacoffee.com/safdarali

👉 Subscribe to my YouTube channel (free):

https://www.youtube.com/@safdarali_?sub_confirmation=1

More about how I work: safdarali.in/about
Projects and case studies: safdarali.in/projects

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.