Change the sky and light colours through the day, also across midnight
Fading between a few colours for morning, noon, evening and night sounds simple, until the blend goes muddy grey in the middle, jumps at midnight or breaks when the clock is set backwards. Here is a clock-to-colour rule that avoids all three.
Why this works
A day is a loop, so midnight is just another point on it, with no seam. Treating the stretch around it like any other makes the colours flow without a jump. Mixing light in the way the eye adds it, not by averaging stored numbers, keeps the middle bright.
When not to use it
Wrong for a game with no passing time or one where day and night are separate places or levels. There, switch between a few fixed looks, because a slow blend would add work and show moments you never designed.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 35 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Change the sky and light colours through the day, also across midnight" (read_entry day-night-colors-that-blend-through-midnight) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP