sky: Midnight Sky and Noonday Sky baked from sun.js (albedo x irradiance)
Two themes replace the navy GameCult theme. Every colour is a bark, leaf, soil or pigment albedo times the irradiance sun.js gives for a fixed moment (equinox noon and midnight, 45N). scripts/bake-sky.mjs writes src/sky/baked.ts: the terrain-free sky gradient used as the fallback background, folds tokens for panels and buttons, chat bubble colours, link and name colours. skyTokens.test.ts holds every text pairing to WCAG AA and fails if baked.ts is stale. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7c89bd0289
commit
7b4aa2f184
11 changed files with 573 additions and 131 deletions
13
scripts/bake-sky.mjs
Normal file
13
scripts/bake-sky.mjs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Bakes Midnight Sky and Noonday Sky from src/sky/sun.js into src/sky/baked.ts.
|
||||
// Run `npm run bake:sky` after changing sun.js, skyTokens.js or a moment.
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { bakeSky } from '../src/sky/skyTokens.js';
|
||||
|
||||
const out = new URL('../src/sky/baked.ts', import.meta.url);
|
||||
const baked = { midnight: bakeSky('midnight'), noonday: bakeSky('noonday') };
|
||||
writeFileSync(
|
||||
out,
|
||||
`// Generated by scripts/bake-sky.mjs from src/sky/sun.js. Do not edit.\n` +
|
||||
`/* eslint-disable */\n` +
|
||||
`export const baked = ${JSON.stringify(baked, null, 2)} as const;\n`
|
||||
);
|
||||
Loading…
Reference in a new issue