[PR #2001] [MERGED] fix(otome-forge): a colour picked from each look, and no two name plates alike #2068

Closed
opened 2026-11-07 16:39:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/2001
Author: @SpicyMarinara
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/otome-li-accent-colours


📝 Commits (3)

  • 37e1612 fix(otome-forge): a colour picked from each look, and no two name plates alike
  • 3a774fb Merge branch 'staging' into fix/otome-li-accent-colours
  • af00ae2 fix(otome-forge): centre the hue buckets and settle sibling accents in one pass

📊 Changes

20 files changed (+547 additions, -187 deletions)

View changed files

➕ artifacts/otome-forge-0.6.10.zip (+0 -0)
📝 catalog/preview/catalog.json (+8 -8)
📝 catalog/preview/notes.json (+6 -6)
📝 catalog/preview/v2/catalog.json (+8 -8)
📝 catalog/preview/v2/notes.json (+6 -6)
📝 catalog/preview/v3/catalog.json (+8 -8)
📝 catalog/preview/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+5 -0)
📝 packages/otome-forge/client.js (+82 -81)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+9 -9)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-run.ts (+21 -5)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/accent.ts (+162 -36)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts (+4 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/theme/styles.ts (+6 -5)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/runs.ts (+8 -3)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/state.ts (+1 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/unit.ts (+2 -0)
📝 scripts/build-feature-packages.mjs (+1 -1)
➕ tests/otome-forge-accents.regression.ts (+199 -0)

📄 Description

Closes #2003

Why this change

Every love interest in a cast showed the same green name plate and the same green glow behind their art, while an older story showed a different colour each — a regression, not the design.

The portrait picker averaged every coloured pixel in the upper half of a look. Looks are now painted on a chroma matte (S/art/prompts.ts MATTES: chroma green, or magenta/cyan when the look names green) so the cut-out can key it out. The backdrop is the largest, most saturated thing in the frame, so it dominated the average and the colour saved to unit.accent was the backdrop. accentIsPlaceholder then treated that saved value as his own, so the name-hash palette never got a second chance either.

What changed

The pick is a detail, not an average (client/lib/accent.ts)

  • Grey and transparent pixels never vote.
  • Hue buckets are 15° wide and centred on the matte hues (120, 180, 300), so a painted backdrop whose pixels fall either side of a boundary is counted as one hue rather than split in two.
  • A matte hue that is most of the picture is the backdrop and is dropped; a look dressed in its matte's own colour keeps it when it is not most of the picture.
  • Among the hues a look really carries (a stray edge pixel is not a colour), the most vivid wins, with the bigger hue breaking a near-tie. A small bright earring or a pair of eyes outbids a large dull coat. The sample canvas is 64×48 so a detail is actually sampled.
  • The result is still moved into the same soft, readable range (s 0.62, l 0.74), so contrast is unchanged.

No two plates alike

  • castAccentFor keeps his own colour when no sibling reads as it, else the colour from his name, else the first free palette tone.
  • The picks are settled in one pass: a useRef of the colours already chosen is read and written synchronously before the POST, so two portraits that sample alike cannot both keep that colour, and a failed save hands its colour back.

The glow follows the same colour

  • The per-face aura colours (data-face="tender" etc.) used to replace --of-li-accent outright, so a speaking LI's glow was the same pink/purple/red whoever it was. They now color-mix 45% with his accent: his face warms or cools his own colour rather than replacing it.

Stories already in progress re-pick

  • unit.accentSampler records which picker chose the accent (ACCENT_SAMPLER_VERSION), returned in RunLiView and accepted by POST /runs/:run/lis/:li/accent.
  • accentIsPlaceholder treats an accent from an older picker as unset, so the existing client effect re-samples and re-saves on the next visit. A story on 0.6.9 with five green plates recolours itself when opened.

Image generation is untouched. No change to prompts, mattes, references, painting or the Engine's image routes; the diff is the accent module, the hook that calls it, the run view/route that carries the version, the aura CSS and the tests.

Package and security impact

  • Affected package IDs: otome-forge 0.6.10
  • Engine compatibility impact: none; the new accentSampler field is optional and older documents read with 0
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none; one optional field on the unit document

Validation

  • npm run test:otome-forge: 540/540 TypeScript regressions pass, including tests/otome-forge-accents.regression.ts.
  • npx prettier --check over the CI pattern: clean.
  • node scripts/validate-catalog.mjs: pass. validate-package-locales.mjs, validate-package-locale-keys.mjs, test-catalog-lanes.mjs: pass.
  • node scripts/typecheck-packages.mjs otome-forge: no syntax errors, undefined names or unresolved modules.

Test plan

  • Open a story whose plates are all green (saved on 0.6.9) and confirm each plate and stage glow is now a different colour and stays after a reload.
  • Confirm a plate's colour reads as a detail of that LI's portrait (an earring, the eyes), not the backdrop.
  • Confirm an LI with no portrait still gets the colour from his name.
  • Confirm the glow behind an LI's sprite is tinted by his own colour, and still shifts with his face.
  • Confirm image generation is unchanged (paint a new look, check the reference and the result are the same as before).

Documentation impact

  • No documentation changes needed

UI evidence (if applicable)

Before: every plate and glow the same green. After: one colour per love interest, picked from a detail of his portrait.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/2001 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/otome-li-accent-colours` --- ### 📝 Commits (3) - [`37e1612`](https://github.com/Pasta-Devs/Marinara-Agents/commit/37e1612c112fb6051e398b6ffdc1ef6be5992847) fix(otome-forge): a colour picked from each look, and no two name plates alike - [`3a774fb`](https://github.com/Pasta-Devs/Marinara-Agents/commit/3a774fb5fe35d64223c9538ea49c849699ca7cc3) Merge branch 'staging' into fix/otome-li-accent-colours - [`af00ae2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/af00ae2e85de3ef587b433855ebc74143cba5634) fix(otome-forge): centre the hue buckets and settle sibling accents in one pass ### 📊 Changes **20 files changed** (+547 additions, -187 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.6.10.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+8 -8) 📝 `catalog/preview/notes.json` (+6 -6) 📝 `catalog/preview/v2/catalog.json` (+8 -8) 📝 `catalog/preview/v2/notes.json` (+6 -6) 📝 `catalog/preview/v3/catalog.json` (+8 -8) 📝 `catalog/preview/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+5 -0) 📝 `packages/otome-forge/client.js` (+82 -81) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+9 -9) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-run.ts` (+21 -5) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/accent.ts` (+162 -36) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts` (+4 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/theme/styles.ts` (+6 -5) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/runs.ts` (+8 -3) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/state.ts` (+1 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/unit.ts` (+2 -0) 📝 `scripts/build-feature-packages.mjs` (+1 -1) ➕ `tests/otome-forge-accents.regression.ts` (+199 -0) </details> ### 📄 Description Closes #2003 ## Why this change Every love interest in a cast showed the same green name plate and the same green glow behind their art, while an older story showed a different colour each — a regression, not the design. The portrait picker averaged every coloured pixel in the upper half of a look. Looks are now painted on a **chroma matte** (`S/art/prompts.ts` `MATTES`: chroma green, or magenta/cyan when the look names green) so the cut-out can key it out. The backdrop is the largest, most saturated thing in the frame, so it dominated the average and the colour saved to `unit.accent` was the backdrop. `accentIsPlaceholder` then treated that saved value as his own, so the name-hash palette never got a second chance either. ## What changed **The pick is a detail, not an average** (`client/lib/accent.ts`) - Grey and transparent pixels never vote. - Hue buckets are 15° wide and **centred** on the matte hues (120, 180, 300), so a painted backdrop whose pixels fall either side of a boundary is counted as one hue rather than split in two. - A matte hue that is most of the picture is the backdrop and is dropped; a look dressed in its matte's own colour keeps it when it is not most of the picture. - Among the hues a look really carries (a stray edge pixel is not a colour), the **most vivid** wins, with the bigger hue breaking a near-tie. A small bright earring or a pair of eyes outbids a large dull coat. The sample canvas is 64×48 so a detail is actually sampled. - The result is still moved into the same soft, readable range (s 0.62, l 0.74), so contrast is unchanged. **No two plates alike** - `castAccentFor` keeps his own colour when no sibling reads as it, else the colour from his name, else the first free palette tone. - The picks are settled **in one pass**: a `useRef` of the colours already chosen is read and written synchronously before the POST, so two portraits that sample alike cannot both keep that colour, and a failed save hands its colour back. **The glow follows the same colour** - The per-face aura colours (`data-face="tender"` etc.) used to *replace* `--of-li-accent` outright, so a speaking LI's glow was the same pink/purple/red whoever it was. They now `color-mix` 45% with his accent: his face warms or cools his own colour rather than replacing it. **Stories already in progress re-pick** - `unit.accentSampler` records which picker chose the accent (`ACCENT_SAMPLER_VERSION`), returned in `RunLiView` and accepted by `POST /runs/:run/lis/:li/accent`. - `accentIsPlaceholder` treats an accent from an older picker as unset, so the existing client effect re-samples and re-saves on the next visit. A story on 0.6.9 with five green plates recolours itself when opened. **Image generation is untouched.** No change to prompts, mattes, references, painting or the Engine's image routes; the diff is the accent module, the hook that calls it, the run view/route that carries the version, the aura CSS and the tests. ## Package and security impact - Affected package IDs: `otome-forge` 0.6.10 - Engine compatibility impact: none; the new `accentSampler` field is optional and older documents read with `0` - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none; one optional field on the unit document ## Validation - `npm run test:otome-forge`: **540/540** TypeScript regressions pass, including `tests/otome-forge-accents.regression.ts`. - `npx prettier --check` over the CI pattern: clean. - `node scripts/validate-catalog.mjs`: pass. `validate-package-locales.mjs`, `validate-package-locale-keys.mjs`, `test-catalog-lanes.mjs`: pass. - `node scripts/typecheck-packages.mjs otome-forge`: no syntax errors, undefined names or unresolved modules. ## Test plan - [ ] Open a story whose plates are all green (saved on 0.6.9) and confirm each plate and stage glow is now a different colour and stays after a reload. - [ ] Confirm a plate's colour reads as a detail of that LI's portrait (an earring, the eyes), not the backdrop. - [ ] Confirm an LI with no portrait still gets the colour from his name. - [ ] Confirm the glow behind an LI's sprite is tinted by his own colour, and still shifts with his face. - [ ] Confirm image generation is unchanged (paint a new look, check the reference and the result are the same as before). ## Documentation impact - [x] No documentation changes needed ## UI evidence (if applicable) Before: every plate and glow the same green. After: one colour per love interest, picked from a detail of his portrait. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:39:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#2068
No description provided.