screen.colorDepth 30 means the browser reports 30 bits for each pixel: ten bits for each of red, green and blue, alpha not counted. Chrome answers 30 on a Mac with a ten-bit wide-gamut panel and 24 on most other screens. The CSS (color) media feature reports the same panel per channel, so the 30-bit screen answers (color: 10). One profile of ours claimed 24 and answered (color: 10) in the same page, and a change in our engine now stops that.

What screen.colorDepth 30 counts

The CSSOM View draft defines colorDepth as "the number of bits allocated to colors for a pixel in the output device, excluding the alpha channel". Media Queries Level 4 defines color as "the number of bits per color component of the output device". Three channels, so one is the other times three:

Panelscreen.colorDepth(color: N)
Ordinary, 8 bits a channel248
Ten-bit wide gamut3010

The draft ties them together in a sentence: a browser "must return a value for these attributes at least equal to the value of the color media feature multiplied by three." It also says a browser that does not know the depth, or does not want to give it "for privacy considerations", should return 24. That is the value people spoof to, and it is safe only if (color) comes down to 8 with it.

You can check your own in the developer console:

screen.colorDepth                      // 30 or 24
matchMedia('(color: 10)').matches      // true on a ten-bit panel
matchMedia('(color: 8)').matches       // true on an ordinary one

Every profile is drawn from one real computer, not from separate listsIn Mosaic: Machines that exist. GPU, screen, CPU and fonts from one real device. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

How it works: Machines that exist

How a profile answered 24 and 10

Mosaic profiles have claimed screen.colorDepth inside the engine for some time. A macOS profile claims 30, because a stock Chrome on our Retina Mac answers 30 for both colorDepth and pixelDepth, and an earlier hard-coded 24 had given every macOS profile a value no modern Mac produces. Every other profile claims 24.

The (color) feature had not been changed. It answered from the real display, so a profile claiming 24, run on the ten-bit laptop we build on, reported ten bits per channel. A page could read both in one line of CSS and JavaScript, and the pair broke the spec's own floor: 24 is less than 10 times 3. No real browser can produce it, so it says the value was changed on one route and left on the other, which is the subject of half a spoof.

We found it with the comparison that turned up dark mode and the scroll-bar width: a value identical across two profiles that share nothing, and equal to this machine, is inherited rather than claimed. The rest of what that test found is in values inherited from the host.

One source, divided by three

Four values on a page describe how many bits the panel carries: screen.colorDepth, (color: N), color-gamut and dynamic-range. Three of them were answering from the real display while the first was claimed. The fix was to give all four one source, the claimed depth.

The gamut pair needed no change in the engine. Our generator derives color-gamut from the claimed depth, p3 at 30 bits and srgb at 24, and Chromium's own --force-color-profile switch moves the gamut and the dynamic range together. Picking which colour profile to force took two measurements, and the first choice, hdr10, washed out every page on screen while every readback said it was fine (that story).

(color: N) has no switch, so we changed it inside the engine. The change rewrites MediaValues::CalculateColorBitsPerComponent in Blink's media_values.cc to read the same --fingerprint-color-depth switch that screen.colorDepth reads, and divide by three:

// colorDepth counts all three components; this feature counts one.
return depth / 3;

A monochrome screen still answers 0 first, as Chromium always has. With no switch, the function returns the real panel's value, the same rule as everywhere else in our engine. A profile claiming 24 now answers (color: 8) on any display, and a profile claiming 30 answers (color: 10).

The fix that vanished without a word

The first version of this change added three headers at the top of media_values.cc. Another of our changes already adds the same three to the same file. When part of a change arrives already applied, GNU patch skips the whole change, so the two parts that mattered were dropped without a word, and the build still reported a pass. Our replay of every change against clean Chromium sources caught it. The change adds no headers now, because the file had already been prepared by another one, and a note at its top says so for whoever touches it next.

It is one of our changes to Chromium behind Tesseract Chrome. Each profile's screen is drawn with its GPU, CPU and fonts from one real machine (real device fingerprints), so its colour depth is part of that record, and every route that reports the depth reads the same number.