contrastTextColor matched only #rrggbb and silently returned the dark
fallback for every other form — #000 and #369 produced a black label on a
near-black fill. colorLuminance in the same file already expanded short
hex, so this was an inconsistency, not a contract.
rgbToHex threw a TypeError on non-matching input (matches.length on null)
and rejected rgba() and whitespace-free rgb strings; it now returns and
ignores the alpha channel.
- actions gain optional toggle + selected fields: items render in the shared
tp-popup-menu-item checkmark style (icon faded unless selected/hovered)
- rename the private _onCtxAction dispatcher to _ctxItemClicked so a host
method named _onCtxAction (the natural name for a ctx-action listener)
no longer shadows it and breaks item clicks
_posFixed now resolves a clamp rect (viewport by default; the nearest
containing-block rect when clampToContainer is set) and clamps position,
edges, and max-height against it. Fixes popups rendered under an ancestor
with transform/filter/contain:layout|paint, where position: fixed resolves
against that ancestor and the viewport is the wrong clamp edge.