A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(gates): check-theme holds the panel ramp quieter than the viewport
esenginec04af9c17c33
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex fe3af176b..45e6dd454 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,12 @@ published separately; it ships inside the editor.### Added+- **The build size chart's video slice stops shouting.** That one series was drawn in a+ viewport gizmo colour — the bright kind, built to read over a lit 3D scene — because the+ panel's own label ramp had six members and the chart needed seven. It now has a seventh,+ pitched with the other six, and a gate holds that ramp quieter than the viewport's from+ here on.+- **The editor's faintest label colour is readable.** The colour most labels in the editorare drawn in — file rows, legends, budget captions, hints — sat at 3.26:1 against a panel,below the 4.5:1 that body text needs, so a whole tier of the interface was technicallydiff --git a/desktop b/desktopindex 902fee8ed..a4392da1d 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit 902fee8ed278a321225592b4feda20f969ba67fe+Subproject commit a4392da1d483ce5bc792879595477480ff3286e2diff --git a/tools/check-theme.mjs b/tools/check-theme.mjsindex 514fcd663..00d4a86a7 100644--- a/tools/check-theme.mjs+++ b/tools/check-theme.mjs@@ -2,20 +2,17 @@// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team/**- * @file Whether the editor's text is readable on the surfaces it sits on.+ * @file Whether the editor's colour ramps hold the contracts they were built on.*- * Every invariant in this repository has a gate except the visual layer, which- * is why the visual layer is the one that drifted: `--text-faint` shipped at- * 3.26:1 on a panel — under the 4.5:1 floor for body text — as the colour of- * most labels in the editor, and nothing said so for as long as it took a person- * to compute it by hand.+ * Every invariant here has a gate except the visual layer, which is why the+ * visual layer is the one that drifted: `--text-faint` shipped at 3.26:1 on a+ * panel — under the floor for body text, as the colour of most labels in the+ * editor — and a chart series ran on a 100%-saturated viewport colour.*- * Scope is deliberately one claim: the text ramp against the surface ramp, read- * from the token file. Not the 963 off-grid spacings or the 74 hard-coded hexes- * — those are real and counted in docs/local/, but a gate that reddens on a- * thousand call sites gets switched off, and one that cannot go green teaches- * nothing. This one is green when the ramp is right and red the moment a value- * is darkened past the floor.+ * Two claims, both read off the token file: text stays readable on the surfaces+ * it sits on, and a panel label stays quieter than the viewport. Deliberately+ * NOT the off-grid spacings or the hard-coded hexes (counted in RM-092): a gate+ * that reddens on a thousand call sites gets switched off.*/import { readFileSync } from 'node:fs';import path from 'node:path';@@ -71,6 +68,38 @@ for (const surface of READING_SURFACES) {}}+/**+ * `--cat-*` labels content on a PANEL; `--gizmo-*` draws over a scene and has to+ * win against it. A seventh chart series took `--gizmo-particle` at 100% for want+ * of a `--cat-` member. Whether a panel borrows one ON PURPOSE (streamed-cell+ * labels do, to match the viewport) is intent — a rule for people, RM-092.+ */+const saturation = (hex) => {+ const h = hex.replace('#', '');+ const [r, g, b] = [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16) / 255);+ const [hi, lo] = [Math.max(r, g, b), Math.min(r, g, b)];+ if (hi === lo) return 0;+ const l = (hi + lo) / 2;+ return Math.round(((hi - lo) / (l > 0.5 ? 2 - hi - lo : hi + lo)) * 100);+};++/**+ * Only the panel ramp is held. The reverse — "a gizmo must be vivid" — was+ * written here and measured false: `--gizmo-shadow` is 19%, `--gizmo-stream-cell`+ * 17%, grey on purpose. A gizmo's saturation follows what it draws.+ */+const PANEL_CEILING = 80;++const content = [...css.matchAll(/^\s*(--cat-[a-z-]+):\s*(#[0-9a-fA-F]{6})\b/gm)]+ .map(([, name, hex]) => ({ name, hex, sat: saturation(hex) }));++if (content.length === 0) problems.push(`${TOKENS}: no --cat-* tokens found — the content ramp cannot be read`);+for (const { name, hex, sat } of content) {+ if (sat >= PANEL_CEILING) {+ problems.push(`${TOKENS}: ${name} (${hex}) is ${sat}% saturated — a panel label stays under ${PANEL_CEILING}%, that is viewport brightness`);+ }+}+if (problems.length > 0) {for (const p of problems) console.error(` ${p}`);console.error(`check-theme: ${problems.length} finding(s).`);@@ -78,7 +107,9 @@ if (problems.length > 0) {}const worst = reported.reduce((a, b) => (a.ratio <= b.ratio ? a : b));+const loudest = content.reduce((a, b) => (a.sat >= b.sat ? a : b));console.log(`check-theme: ${textTokens.length} text token(s) over ${READING_SURFACES.length} reading surface(s) — `- + `all >= ${FLOOR}:1, closest is ${worst.name} at ${worst.ratio.toFixed(2)}:1 on ${worst.surface}.`,+ + `all >= ${FLOOR}:1, closest is ${worst.name} at ${worst.ratio.toFixed(2)}:1 on ${worst.surface}. `+ + `${content.length} content label(s) under ${PANEL_CEILING}% saturation, loudest is ${loudest.name} at ${loudest.sat}%.`,);diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 467fdc93d..d980f2ca2 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -49,6 +49,12 @@ export const NOTED = {'feat(gates): the text ramp is held to 4.5:1 on the surfaces text sits on':{ note: "The editor's faintest label colour is readable." },+ 'feat(gates): check-theme holds the panel ramp quieter than the viewport':+ { note: "The build size chart's video slice stops shouting." },++ "fix(theme): the size chart's video series is a panel colour, not a viewport one":+ { note: "The build size chart's video slice stops shouting." },+"fix(gates): the acknowledged build's cleanup retries, as every recursive delete must":{ internal: "An editor check's own temp-directory cleanup; no creator runs it." },