A native <input type="color"> opens the OS's own color picker (palette, eyedropper) on click, so accessibility comes for free with no extra work. To restrict choices to a fixed set — a brand palette, say — a custom swatch grid uses role="radiogroup" with each swatch as role="radio", so only one is selected at a time and arrow keys move between them.
Conveying selection or meaning through color alone leaves colorblind and low-vision users unable to tell swatches apart — the same problem the a11y category's "don't rely on color alone" principle addresses. The selected swatch needs a shape signal too — a ring, a checkmark — independent of its color, and each swatch's aria-label should spell out the color's name ("Purple," "Pink") so a screen reader user knows what they're picking.
If free-form color entry is needed too — typing a hex code, dragging a wheel — a common layout adds a "Custom" swatch next to the palette that opens a larger picker (usually HSL or per-channel sliders) when pressed.