A palette of swatches for choosing one color, the APG listbox laid out in rows, as a form control, in each framework.
Choose one color from a palette: the APG
listbox in single selection, its options laid
out in wrapping rows by your styles, the vertical arrows moving between rows. It works in a native
<form> and a Field, and inside a ColorPicker it
shows and sets the picker's color.
Value: a Color or null; an option is selected when its color is the value's (compared
as #rrggbbaa, so an hsb value selects the #ff0000 swatch of the same color).
Keys: ArrowRight / ArrowLeft along the list (swapped in RTL, wrapping), ArrowDown / ArrowUp
to the nearest option of the row below or above (measured on the rendered layout), Home / End;
a focus move never selects, Space and Enter do (the APG's recommended model).
Pointer: a press focuses and selects; a disabled option takes focus, never the selection.
Forms: a hidden input submits the selected color as hex; a form reset returns to the default.
In a ColorPicker, with neither value nor defaultValue, it is bound to the picker's color
(and submits nothing of its own).
Every part also takes what the primitive contract gives:
render (Vue: as and the render slot), a class and a style, a ref, and any attribute, which
it forwards. The names below are React's; Vue binds them the same way (v-model:value), and
Angular as inputs and outputs ([(value)], (valueChangeDetails)).