Which near-whites does Outlook for Mac leave alone?
In dark mode, Outlook for Mac can flip white and near-white email backgrounds to dark colours. I wanted to keep a light background in both themes. Could I get away with nudging the hex code?
I tried the 1,000 colours closest to white as solid HTML backgrounds. In light mode every one came back exactly as I’d set it. In dark mode, Outlook darkened the lot.
TL;DR; what works?
On a 540px card in Outlook for Mac, box-shadow: inset 0 0 0 300px #FFFFFF kept the cell white without an image. Outlook can flip the text colour too. With color: #202020 alone, the charcoal text went pale in dark mode. Adding -webkit-text-fill-color: #202020 kept the lettering charcoal in both modes.
The 10 closest colours Outlook left alone
After failing to see a working white-ish colour with the first 1000 colours, I tried a second grid with darker colours, bringing the total to 1,981 solid background colours. These are the 10 closest to white that kept their exact RGB values in both modes. The closest I found was #777777, a mid-grey.
| Hex colour | RGB |
|---|---|
#777777 | 119, 119, 119 |
#767676 | 118, 118, 118 |
#757575 | 117, 117, 117 |
#646464 | 100, 100, 100 |
#636363 | 99, 99, 99 |
#626262 | 98, 98, 98 |
#616161 | 97, 97, 97 |
#606060 | 96, 96, 96 |
#5F5F5F | 95, 95, 95 |
#5E5E5E | 94, 94, 94 |
See the wider grid in light mode and dark mode.
What dark mode did to the 1,000 near-whites
Turning on dark mode sent pure white all the way down to #1E1E1E. Take one point off the blue channel (#FFFFFE) and Outlook made it #515150. Take one off all three (#FEFEFE) and it came back as #1F1F1F.
The top-left swatch inside the coloured border changed from #FFFFFF to #1E1E1E in dark mode.
How I checked the colours in both modes
I laid out the test email as a grid of little squares. Each square was a table cell with the same hex code in bgcolor and inline background-color. To rank the colours by distance from white, we square how far each RGB channel was from 255 and add the three numbers.
Using Preflight, I was able to capture the email in Outlook for Mac in light and dark mode. Converting the captures to sRGB, then had the colours sampled a five-by-five pixel square in the centre of each swatch. A match in both light and dark mode is when both screenshots gave me the RGB I’d set in the HTML.
The second grid included all 256 neutral greys, a spread of colours across the RGB range, and a few more pale tints. I found 105 exact matches in that wider grid. The two grids had 19 colours in common, and those came back the same both times.
In the wider grid, the red channel came back one point higher in light mode for 13 saturated cyan shades. Dark mode changed all 13 as well.
Would changing how I set the background help?
I gave the 200 closest colours another go with five ways of setting the background. Trying bgcolor and inline hex together and on their own, inline RGB on a <div> inside the cell, and a solid linear-gradient() over a matching background colour.
All 1,000 swatches matched in light mode and changed in dark mode. With each of the five declarations, #FFFFFE still came back as #515150.
I also tried taking the edge off white with a bit of transparency. At about 99.6% opacity over black, rgba(), eight-digit hex, and element opacity all gave me #FEFEFE in light mode and #1E1E1E in dark mode. None of the 80 CSS variations in that grid kept a near-white in both modes.
I tried !important too, and adding it gave me the same RGB as the ordinary declaration in all 75 inline pairs in each mode. A stylesheet rule with !important won over a different inline fill in light mode, and Outlook still took #FEFEFE down to #1F1F1F in dark mode.
How I kept the card white and the text dark
I gave the table cell a blue background and a white inset shadow. On the 540px card, a 300px spread was enough to cover the blue. With ordinary color alone, Outlook for Mac turned my charcoal text #E4E4E4 in dark mode while the card stayed white. Setting -webkit-text-fill-color: #202020 on the span kept the lettering charcoal in both modes.
Classic Outlook for Windows showed me the blue fallback, and Apple Mail on my Mac darkened the inset in dark mode. I’d check the text against those backgrounds too.
I’d hoped I could change one digit in #FFFFFF and call it at that. The closest solid colour I found was #777777, which is no good for pretending to be white.. So for Outlook, using the inset and the text fill together seem to be the way forward.
Data
If you are interested in the data points generated to do this, here they are:
- The 1,000 colours closest to white (CSV)
- The wider grid of solid background colours (CSV)
- The 200 closest colours tested with five background styles (CSV)
- The 80 transparency and colour tests (CSV)
- Background colours with and without
!important(CSV) - Background and text colours on the inset card in both modes (CSV)

