Files
amethyst/commons/src/commonMain
Claude 440fc61104 feat(audio-rooms): RoomTheme projection from kind-30312 (T3 #1)
Materialised view of the kind-30312 theme tags into a small
renderer-friendly struct. Pure data + a `from(event)` projection
function — the Compose `AudioRoomThemedScope` wrapper consumes it
later.

  RoomTheme — packs colors as `0xAARRGGBB` Long (full alpha)
              so commons stays free of the Android Color type;
              the Compose renderer recovers via `Color(argb)`.
              `null` per field means "use the platform default" so
              partial themes (background-only, primary-only, etc.)
              fall back per-field.

  RoomTheme.Empty — sentinel for un-themed rooms; renderer can pass
                    it unconditionally without an extra null branch.

  RoomTheme.from(event) — picks the FIRST color per target (palette
                          fallbacks deferred to a later phase),
                          drops typo'd hex via Quartz's strict
                          ColorTag parser (returns null per field
                          rather than crashing), maps the
                          BackgroundTag mode to the renderer enum
                          (unknown wire modes fall back to COVER).

Tests:
  * Empty event → empty theme
  * Three color targets project to opaque ARGB Longs
  * First-per-target wins (extra colors ignored in v1)
  * Typo'd hex leaves null per field; OTHER colors still project
  * Background URL + tile mode round-trip
  * Unknown bg mode (a future "blur") → COVER fallback
  * hexToOpaqueArgb always sets alpha=0xFF (no inadvertent
    transparency for #000000)

Compose renderer + AudioRoomThemedScope wrapper come next.
2026-04-26 23:01:51 +00:00
..