feat(inspector): pick any object colour, not just the six presets (#88) - #89
Merged
Conversation
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
force-pushed
the
fix/issue-88
branch
from
September 3, 2026 14:25
a97e5b2 to
3bb33f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #88.
What
OBJECT_COLORSgains four saturated blocking presets (red, blue, yellow, green) after the six neutrals.<input type="color">swatch and a hex text field, both routed through the samechangeSceneObjectpath as the presets. Malformed hex (zzz,#12, empty) is ignored without touching the record.cozyclay.objectColors.recent, newest first, deduped, capped at 6, presets skipped) and offered after the palette. Any hex set through MCPupdate_objectnow reads back in the hex field and can be re-picked.Tests
test/verify-scene-objects.mjs: +12 assertions (palette,normalizeObjectColor,rememberObjectColordedupe/cap/preset-skip/sanitise). Captured RED before the palette change.test/verify-object-colour-browser.mjs(CDP, inBROWSER_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 testgreen locally.