This page’s formula is built directly from one peer-reviewed study. Nothing on this page is invented math — every step either comes from that paper, from real measured pixels on the Sleep Planner page, or from a plainly-flagged assumption.
That paper measured, in real people, how much light of different colors and brightness levels suppresses melatonin, and for how long people were exposed. It gives a real number called ED50 — the light dose needed to cause 50% suppression — and this number changes depending on how many minutes someone has been looking at the light.
Below is every factor the formula uses, in plain English. Anywhere this page guesses or assumes something instead of measuring it, that is flagged.
Every pixel on the real Sleep Planner page, in sleep mode, is read and counted. All of them are then averaged into one overall red, green and blue value. This is measured, not guessed.
Screens store color in a boosted way so it looks right to human eyes. This step undoes that boost, so the math uses the screen’s true physical brightness fraction, not the display trick.
The screen’s true brightness in real light units, found by multiplying the linear brightness (Y) by the screen’s peak brightness.
The physical size of the screen, and how far the eyes are from it. Both are needed to work out how much of a person’s view the screen actually fills.
How much of the person’s field of view the screen fills, worked out from real geometry: screen area divided by viewing distance squared. A bigger, closer screen fills more of the view.
How much light actually lands on the eye. Found by multiplying the screen’s brightness (L) by the solid angle from Step 5. This is the real, physical light dose reaching the eye — not just how bright the screen looks.
A number in Kelvin describing how warm or cool a color looks. It is worked out purely from the average red, green and blue values in Step 1 — nothing else feeds into it. Warmer (lower K) light is gentler on melatonin; cooler, bluer (higher K) light is harsher.
A score for how harsh a light’s specific color is on melatonin, based on its color temperature (CCT) from Step 7.
The real “melatonin-relevant” light dose. Found by multiplying corneal illuminance (E, Step 6) by the melanopic ratio (Rm, Step 8). This single number is what gets compared against the real published threshold in Step 10.
A real, published number from Giménez et al. 2022: the light dose (in melanopic EDI) that causes 50% suppression, for a given number of minutes of viewing. This number is different for every exposure length — the longer someone looks at a light, the lower the dose needed to reach 50% suppression.
Controls how sharply suppression ramps up once light passes the ED50 threshold from Step 10.
This compares the real light dose reaching the eye (melanopic EDI, Step 9) against the real published threshold for that viewing time (ED50, Step 10). The closer the dose is to, or above, the threshold, the higher the suppression percent.
Both examples use a real, full pixel-by-pixel scan of the live Sleep Planner page with sleep mode switched on — every pixel on screen was read and counted, then averaged. Screen sizes shown are typical reference sizes (a common laptop size, and an iPhone 12) — not a measurement of any specific person’s own device.
Every color found on screen, sorted by pixel count. This is the real, full pixel count — not a sample. Colors under 0.08% of the screen are grouped into “Other.”
| Color (RGB) | Blue Level (0-100%) | Pixels | % of screen |
|---|---|---|---|
| 0, 0, 0 | 0% | 876,020 | 67.594% |
| 48, 48, 48 | 18.8% | 228,222 | 17.610% |
| 240, 248, 248 | 97.3% | 65,632 | 5.064% |
| 16, 152, 136 | 53.3% | 40,756 | 3.145% |
| 32, 144, 136 | 53.3% | 9,088 | 0.701% |
| 40, 144, 136 | 53.3% | 8,859 | 0.684% |
| 8, 8, 8 | 3.1% | 7,620 | 0.588% |
| 24, 144, 136 | 53.3% | 4,923 | 0.380% |
| 16, 16, 16 | 6.3% | 4,701 | 0.363% |
| 216, 216, 216 | 84.7% | 3,383 | 0.261% |
| 152, 152, 152 | 59.6% | 2,434 | 0.188% |
| 255, 255, 255 | 100% | 2,163 | 0.167% |
| 24, 24, 24 | 9.4% | 1,914 | 0.148% |
| 104, 104, 104 | 40.8% | 1,697 | 0.131% |
| 88, 88, 88 | 34.5% | 1,611 | 0.124% |
| 8, 104, 96 | 37.6% | 1,546 | 0.119% |
| 136, 136, 136 | 53.3% | 1,519 | 0.117% |
| 16, 144, 136 | 53.3% | 1,510 | 0.117% |
| 232, 96, 80 | 31.4% | 1,494 | 0.115% |
| 72, 72, 72 | 28.2% | 1,277 | 0.099% |
| 224, 224, 224 | 87.8% | 1,124 | 0.087% |
| 16, 80, 72 | 28.2% | 1,116 | 0.086% |
| 248, 248, 248 | 97.3% | 1,093 | 0.084% |
| Other (452 minor colors) | — | 26,296 | 2.029% |
Averaging every row above gives the overall screen color used below.
| Input / Step | Value |
|---|---|
| Average screen color (R,G,B) | 27.0, 33.9, 33.4 |
| Linear brightness (Y, gamma undone) | 0.0148 |
| Screen luminance (L, 300 cd/m² peak assumed) | 4.45 cd/m² |
| Screen size & distance (assumed: 15.4in laptop, 60cm) | 0.0688 m² @ 0.6m |
| Solid angle at eye | 0.191 sr |
| Corneal illuminance (E) | 0.849 lux |
| Color temperature (CCT) | 7736 K |
| Melanopic ratio (Rm, assumed formula) | 1.27 |
| Melanopic EDI | 1.07 lux |
| Real ED50 for 60 min (Giménez et al. 2022) | 350 lux |
| Curve steepness n (assumed, unverified) | 1.2 |
| Minutes viewed (separate input) | 60 |
Every color found on screen, sorted by pixel count. This is the real, full pixel count — not a sample. Colors under 0.08% of the screen are grouped into “Other.”
| Color (RGB) | Blue Level (0-100%) | Pixels | % of screen |
|---|---|---|---|
| 0, 0, 0 | 0% | 162,374 | 53.325% |
| 48, 48, 48 | 18.8% | 84,179 | 27.645% |
| 240, 248, 248 | 97.3% | 12,313 | 4.044% |
| 16, 152, 136 | 53.3% | 11,806 | 3.877% |
| 40, 144, 136 | 53.3% | 3,100 | 1.018% |
| 216, 216, 216 | 84.7% | 3,043 | 0.999% |
| 32, 144, 136 | 53.3% | 2,777 | 0.912% |
| 8, 8, 8 | 3.1% | 2,700 | 0.887% |
| 16, 16, 16 | 6.3% | 1,890 | 0.621% |
| 255, 255, 255 | 100% | 1,751 | 0.575% |
| 24, 144, 136 | 53.3% | 1,294 | 0.425% |
| 232, 96, 80 | 31.4% | 1,177 | 0.387% |
| 24, 24, 24 | 9.4% | 947 | 0.311% |
| 224, 224, 224 | 87.8% | 904 | 0.297% |
| 208, 208, 208 | 81.6% | 636 | 0.209% |
| 8, 0, 0 | 0% | 558 | 0.183% |
| 248, 248, 248 | 97.3% | 541 | 0.178% |
| 192, 200, 200 | 78.4% | 403 | 0.132% |
| 16, 136, 128 | 50.2% | 395 | 0.130% |
| 224, 48, 72 | 28.2% | 387 | 0.127% |
| 16, 144, 136 | 53.3% | 383 | 0.126% |
| 8, 128, 120 | 47.1% | 364 | 0.120% |
| 152, 152, 152 | 59.6% | 360 | 0.118% |
| 232, 232, 232 | 91.0% | 339 | 0.111% |
| 232, 104, 88 | 34.5% | 339 | 0.111% |
| 80, 80, 80 | 31.4% | 313 | 0.103% |
| 24, 112, 104 | 40.8% | 312 | 0.102% |
| 24, 80, 80 | 31.4% | 271 | 0.089% |
| 32, 96, 96 | 37.6% | 257 | 0.084% |
| Other (393 minor colors) | — | 8,388 | 2.754% |
Averaging every row above gives the overall screen color used below.
| Input / Step | Value |
|---|---|
| Average screen color (R,G,B) | 35.5, 43.9, 43.2 |
| Linear brightness (Y, gamma undone) | 0.0234 |
| Screen luminance (L, 300 cd/m² peak assumed) | 7.01 cd/m² |
| Screen size & distance (iPhone 12, as given) | 0.0091 m² @ 0.3m |
| Solid angle at eye | 0.101 sr |
| Corneal illuminance (E) | 0.712 lux |
| Color temperature (CCT) | 7708 K |
| Melanopic ratio (Rm, assumed formula) | 1.26 |
| Melanopic EDI | 0.90 lux |
| Real ED50 for 60 min (Giménez et al. 2022) | 350 lux |
| Curve steepness n (assumed, unverified) | 1.2 |
| Minutes viewed (separate input) | 60 |
Not because the phone screen is a different color — the colors are almost identical (both are the same warm charcoal/gold sleep theme). Mobile scores slightly higher because, on the smaller screen, the bright UI elements (cards, icons, white text) take up a bigger share of the total pixels. Less black background to dilute them, so the average brightness comes out a little higher.
| Color | Blue Level (0-100%) | Where it dominates |
|---|---|---|
| 0,0,0 (black) | 0% | 67.6% of desktop, 53.3% of mobile — main background |
| 48,48,48 (charcoal) | 18.8% | 17.6% of desktop, 27.6% of mobile — card backgrounds |
| 16,152,136 (teal-green) | 53.3% | 3.1% of desktop, 3.9% of mobile — a mid-range blue level (the near-white rows above score higher on this scale) |
Blue Level (0-100%) here means: how strong the blue channel itself is, out of its highest possible value of 255 (blue ÷ 255 × 100). 0% = no blue at all. 100% = the strongest blue a screen can show. This measures each color’s actual blue output, not a share of its own color mix — so pure white correctly shows as 100% (maximum blue), well above a neutral gray.
The reason it is this low is not one single trick — it is three things stacking together. The theme is very dark (most of the screen is near-black, so real brightness reaching the eye is tiny). The few bright accents that do appear are a warm teal-green, not a cool blue-white, which keeps the melanopic ratio (Rm) lower than a plain white screen would give. And a phone or laptop held at arm’s length only fills a small slice of the field of view, so even a bright patch delivers far less light to the eye than the same brightness would up close. Section 5 below shows what happens when the “dark” part of that combination is removed.
This does not mean screens at night are always harmless. Real published lab measurements of ordinary phone use — full brightness, plain white content, held close, in an otherwise dark room — have measured 7% to 11% suppression after a couple of hours. Sleep Planner’s Sleep Mode avoids that by being dark and warm-colored by design, which is exactly what this page’s numbers show.
This section keeps every assumption the same (screen size, viewing distance, 300 cd/m² peak brightness, 60 minutes viewed) and only changes one thing: every pixel is now pure white (255, 255, 255) instead of the sleep-mode colors above. This shows how much of Sleep Planner’s low suppression number comes specifically from being dark.
| Input / Step | Desktop, sleep mode (actual) | Desktop, full white | Mobile, sleep mode (actual) | Mobile, full white |
|---|---|---|---|---|
| Linear brightness (Y) | 0.0148 | 1.0 | 0.0234 | 1.0 |
| Screen luminance (L) | 4.45 cd/m² | 300 cd/m² | 7.01 cd/m² | 300 cd/m² |
| Corneal illuminance (E) | 0.849 lux | 57.30 lux | 0.712 lux | 30.30 lux |
| Color temperature (CCT) | 7736 K | 6503 K | 7708 K | 6503 K |
| Melanopic ratio (Rm) | 1.27 | 1.056 | 1.26 | 1.056 |
| Melanopic EDI | 1.07 lux | 60.48 lux | 0.90 lux | 31.98 lux |
| Suppression, 1 hour | 0.10% | 10.84% | 0.08% | 5.36% |
- Open the real Sleep Planner page, sleep mode switched on.
- Take a full, exact picture of the whole screen, matching the real screen size exactly.
- Read the color of every single pixel in that picture — not a sample, every one.
- Round each pixel’s color slightly (to the nearest step of 8) so that thousands of near-identical shades from smooth edges and gradients count as one color, without changing what the color looks like.
- Count how many pixels landed in each rounded color.
- Sort by count. Anything under 0.08% of the screen gets grouped into “Other” so the list stays short.
- Average all the real pixel colors together to get one overall screen color, then run that through Steps 1–12 in Part 2 above.
Based on everything above, here is practical advice in three areas: color choices, filters, and device habits. Each “avoid” line says why, using the real numbers from this page.
- Turn the device’s own brightness down before bed, not just relying on a dark theme inside the app. Brightness is the number one factor in this formula.
- Turn on the device’s built-in night mode or warm color mode in the evening, on top of any in-app dark theme.
- Hold phones further away, or sit further back from a laptop screen. Distance cuts down how much light actually reaches the eye — the same math used throughout this page.
- Keep evening screen sessions short. The real published science (Giménez et al. 2022) shows that the longer someone looks at a light, the less bright it needs to be to cause the same effect — so a quick check before bed is safer than a long scroll.