Most "auto" VS Code themes flip between two fixed themes at a set time. I wanted something closer to the sky outside the window: crisp and cool at noon, warm and low-blue after dark, in both dark and light. The result is Skymood, a free, open-source VS Code theme that blends four palettes (Night, Dawn, Day, Dusk) minute by minute, following the real sunrise and sunset for your city.
The hard part wasn't making it pretty. It was keeping it readable at every one of the 1,440 minutes in a day, in every combination of settings. Here's how that works.
The pipeline
Every color goes through the same pure function, so the extension and the test suite run the exact same code path:
phase blend (OKLab) → atmosphere (OKLCH) → night warmth → playful tints → WCAG contrast clamp (always last) 1. Blend in OKLab, not RGB
Blending two hex colors in sRGB gives muddy midpoints: halfway between a rose dawn and a cool blue day is a dull grey-brown. Skymood converts each palette to OKLab, a perceptual color space, weights the four phases by the time of day, and converts back. Transitions stay clean all the way through.
The phase weights come from anchors around sunrise and sunset (night until ~90 minutes before sunrise, dawn, day, dusk, then night again), with a smoothstep between neighbours, so there's never a visible jump.
2. Sunrise and sunset, offline
Pick a city (350 are built in) or type coordinates, and Skymood calculates sunrise and sunset with the NOAA solar equations. No network calls, no telemetry. The tests compare the results with published almanac times for Quito, Singapore, London, New York, Sydney and Reykjavík. Polar day and polar night return null, and the extension falls back to fixed times.
3. Atmospheres in OKLCH
On top of the solar phase you can layer an atmosphere: Overcast (about 28% less chroma, slate neutrals), Arctic (ice tones, longer twilight) or Amber (warm, with strong blue-light reduction at every hour). These are rotations and chroma changes in OKLCH, so hue and lightness stay predictable.
4. The contrast clamp runs last
Atmospheres, night warmth and the playful tints (more on those below) all move colors around. Any of them could push a token below a readable contrast. So the last step of the pipeline nudges every code color away from the background until it meets the target:
function ensureContrast(fg, bg, min) { if (contrast(fg, bg) >= min) return fg; // already readable const [L, C, h] = hexToOklch(fg); // move away from the background const target = luminance(fg) >= luminance(bg) ? 1 : 0; // binary search on lightness only: hue and chroma are kept let lo = L, hi = target; for (let i = 0; i < 24; i++) { const mid = (lo + hi) / 2; const ok = contrast(oklchToHex(mid, C, h), bg) >= min; if (ok) hi = mid; else lo = mid; } return oklchToHex(hi, C, h); } Code text gets 4.5:1 (WCAG AA), comments 3:1. Because only lightness changes, a pink keyword stays pink; it just gets a little brighter or darker when it needs to.
A test that checks every minute
npm test composes the full theme for every minute of the day, for three sunrise/sunset scenarios (a normal day, a high-latitude summer and a high-latitude winter), in all four atmospheres, dark and light, with every playful tint off and then at full strength. Every token is checked against the background. It's zero-dependency Node and finishes in about ten seconds.
That test caught things I would never have spotted by eye, and it's what made the next release possible.
What 2.2.0 fixed: colors that were readable but indistinguishable
Contrast alone isn't enough. In earlier versions, warnings, info and git "modified" borrowed syntax colors. At night, the "number" and "constant" colors are both warm oranges, so a warning, an error and a modified file were near-identical (a perceptual difference of ΔE ≈ 2, which is barely noticeable).
So 2.2.0 gives each palette dedicated status slots (a gold for warnings, a blue for info, a green for "added", plus a cyan and a magenta for the terminal), and the tests now check that these pairs stay apart, not just readable:
apart('editorWarning.foreground', 'editorError.foreground', 6); apart('terminal.ansiRed', 'terminal.ansiMagenta', 6); apart('gitDecoration.modifiedResourceForeground', 'gitDecoration.deletedResourceForeground', 6); The same clamp now covers the integrated terminal too: every ANSI text color stays at or above 4.5:1 against the terminal background. In the light themes, terminal white used to be as low as 2.3:1.
There's also a new command, Skymood: Preview Sunrise or Sunset, which plays a single transition with today's sun times. It's much quicker than the full 24-hour preview when you want to judge how dusk into night really feels.
The playful part
Skymood also notices what you're doing, and every effect can be switched off on its own:
- Flow glow: accents brighten after 5, 15 and 30 minutes of steady typing.
- Bug mood: when new errors stick around, the editor fades to a soft red and back.
- Victory: fix the last error and confetti bursts in the colors of the current hour.
- Golden hour shimmer at sunrise and sunset, and the moon phase in the status bar.
Every one of those tints goes through the contrast clamp, so they can't make code harder to read.
Try it
Install it from the Extensions view (search "Skymood"), or:
code --install-extension mvnandhakumar.skymood-theme Then run Skymood: Preview a Full Day and watch 24 hours go by in 7 seconds.
- Marketplace: https://marketplace.visualstudio.com/items?itemName=mvnandhakumar.skymood-theme
- Source (MIT): https://github.com/Nandha65/skymood-theme
I'd love feedback, especially on light-mode contrast and how the shifts feel over a long session. If you're building your own theme, the blend-then-clamp approach and the every-minute test are worth stealing.
This post was drafted with AI assistance and reviewed and verified by me against Skymood's actual code and release details.



