Skip to content

feat(inspector): pick any object colour, not just the six presets (#88) - #89

Merged
HaD0Yun merged 1 commit into
mainfrom
fix/issue-88
Sep 3, 2026
Merged

feat(inspector): pick any object colour, not just the six presets (#88)#89
HaD0Yun merged 1 commit into
mainfrom
fix/issue-88

Conversation

@HaD0Yun

@HaD0Yun HaD0Yun commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #88.

What

  • OBJECT_COLORS gains four saturated blocking presets (red, blue, yellow, green) after the six neutrals.
  • The Inspector colour popover grows a native <input type="color"> swatch and a hex text field, both routed through the same changeSceneObject path as the presets. Malformed hex (zzz, #12, empty) is ignored without touching the record.
  • Hand-mixed tints are remembered per browser (cozyclay.objectColors.recent, newest first, deduped, capped at 6, presets skipped) and offered after the palette. Any hex set through MCP update_object now reads back in the hex field and can be re-picked.

Tests

  • test/verify-scene-objects.mjs: +12 assertions (palette, normalizeObjectColor, rememberObjectColor dedupe/cap/preset-skip/sanitise). Captured RED before the palette change.
  • New real-browser suite test/verify-object-colour-browser.mjs (CDP, in BROWSER_FILES): types #ff3366, asserts the live three.js material, the saved scene doc, details[open], malformed input inertness, and the recent list surviving a reload. 23/23 PASS locally on Apple M4 Pro (ANGLE Metal).
  • npm test green locally.

The object palette was six neutrals, so a blockout could not even say
"the red ball, the blue box" — and an agent's update_object could put a
hex on a prop that the inspector had no way to show, let alone re-pick.

Four saturated presets join the neutrals, and the popover grows a free
colour: the native picker for choosing one, a hex field for typing or
reading back an exact value. The field parses what people actually type
(#f36, ff3366, upper case) and ignores anything else — a half-typed hex
is a keystroke on the way somewhere, not an instruction to repaint. Both
inputs deliberately leave the popover open, unlike a preset click, which
still closes it once the choice is made.

Hand-mixed tints are remembered per browser (newest first, deduped,
capped at six, presets skipped) and offered after the palette behind a
rule, so a colour an agent chose stays reachable across sessions. The
memory is an editor preference: it lives in its own storage key, never
in the scene document.
@HaD0Yun
HaD0Yun merged commit 4e147ab into main Sep 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspector: 오브젝트 색상이 프리셋 6개로 고정, 임의 색 선택 불가

1 participant