From 76daf7cdca2cb26262ad56af858c4ef52a4b5ddf Mon Sep 17 00:00:00 2001 From: Void Date: Mon, 9 Nov 2026 22:32:56 +0000 Subject: [PATCH] Re-pin the bare-sky ratios on skyBackdrop's union ranges #47 makes skyBackdrop the union of the skies the scenes draw: day 0.238-0.919, dusk 0.017-0.965, night 0.058-0.077. Only night text still clears 4.5:1 on bare sky (5.05); day falls to 3.71 text / 2.56 link. Everything outside a bubble stays on the plate. Co-Authored-By: Claude Sonnet 5.5 --- src/app/features/scene/skyTheme.test.ts | 13 +++++++------ src/app/features/scene/skyTheme.ts | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/features/scene/skyTheme.test.ts b/src/app/features/scene/skyTheme.test.ts index 53a68c5c..3fd06875 100644 --- a/src/app/features/scene/skyTheme.test.ts +++ b/src/app/features/scene/skyTheme.test.ts @@ -45,11 +45,12 @@ describe('skyThemeId', () => { }); describe('ink of the theme a state picks, on bare sky', () => { - // Per state: the picked theme, its ink and link, and their ratios on bare sky. A theme's own - // ink is not chosen for bare sky, so only day and night text pass (skyState.test.ts), and no - // link does (night 2.36): links never rest on bare sky, they sit on the plate below. + // Per state: the picked theme, its ink and link, and their ratios on bare sky, over the union + // of the skies the scenes draw (skyBackdrop). Only night text passes (5.05); day's sky reaches + // 0.919 and dusk's 0.017 to 0.965, so no theme's ink holds there. No link passes anywhere + // (night 2.36): nothing rests on bare sky, everything sits on the plate below. const cells: [SkyState, string, string, string, string, string][] = [ - ['day', 'noonday-sky', '#342d25', '7.62', '#2a4f27', '5.25'], + ['day', 'noonday-sky', '#342d25', '3.71', '#2a4f27', '2.56'], ['dusk', 'noonday-sky', '#342d25', '1.00', '#2a4f27', '1.00'], ['night', 'midnight-sky', '#aeccff', '5.05', '#609385', '2.36'], ]; @@ -62,11 +63,11 @@ describe('ink of the theme a state picks, on bare sky', () => { expect(r2(ratio(link, skyBackdrop(state)))).toBe(wantLink); }); - it('only the cells that clear AA on bare sky carry text there', () => { + it('night is the only state whose text clears AA on bare sky', () => { const passing = fixed.filter( ([s, id]) => ratio(SKY[id].tokens.Background.OnContainer, skyBackdrop(s)) >= AA ); - expect(passing.map(([s]) => s)).toEqual(['day', 'night']); + expect(passing.map(([s]) => s)).toEqual(['night']); }); }); diff --git a/src/app/features/scene/skyTheme.ts b/src/app/features/scene/skyTheme.ts index ebd4504f..8854fcd4 100644 --- a/src/app/features/scene/skyTheme.ts +++ b/src/app/features/scene/skyTheme.ts @@ -1,9 +1,10 @@ // Which theme a sky state lights the page with. 'auto' picks none: the page keeps the theme it // would have had (the user's choice when signed in, Midnight Sky when signed out). // -// Day and Dusk take the dark ink of Noonday Sky, Night the light ink of Midnight Sky. Dusk's -// gradient runs from near-black to bright orange, so no single ink reads on all of it; Dusk -// text therefore only ever sits on a theme surface, never on bare sky (skyTheme.test.ts). +// Day and Dusk take the dark ink of Noonday Sky, Night the light ink of Midnight Sky. On bare sky +// only Night's text clears 4.5:1 (5.05); Day's sky reaches 0.919 luminance and Dusk's spans +// 0.017 to 0.965, so no ink holds there. Text therefore never rests on bare sky: every region +// that would is a plate (skyPlate.css.ts), and skyTheme.test.ts pins the numbers. import type { SkyState } from './skyState'; export type SkyThemeId = 'midnight-sky' | 'noonday-sky';